1 Star 0 Fork 1

zL/vite-antd-motion-reactjs-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.js 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
import { defineConfig } from "vite";
import path from "path";
import react from "@vitejs/plugin-react";
import viteCompression from "vite-plugin-compression";
import vitePluginImp from "vite-plugin-imp";
export default defineConfig({
plugins: [
react({
babel: {
plugins: ["@babel/plugin-transform-react-jsx"],
},
}),
vitePluginImp({
libList: [
{
libName: "antd",
style: (name) => `antd/es/${name}/style`,
},
],
}),
viteCompression({
disable: false, // 官网可配置 build 是否压缩 filter 可过滤压缩文件
}),
],
resolve: {
alias: {
"~": path.resolve(__dirname, "./"), // 根路径
"@": path.resolve(__dirname, "src"), // src 路径
},
},
optimizeDeps: {
esbuildOptions: {
loader: { ".js": "jsx" },
},
},
build: {
rollupOptions: {
output: {
chunkFileNames: "static/js/[name]-[hash].js",
entryFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name]-[hash].[ext]",
},
},
terserOptions: {
// 清除 log 和 debugger
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
modifyVars: {
"@primary-color": "#4377FE", //设置antd主题色
},
},
},
},
server: {
port: 3001,
host: "0.0.0.0",
open: false,
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lilongji/vite-antd-motion-reactjs-template.git
[email protected]:lilongji/vite-antd-motion-reactjs-template.git
lilongji
vite-antd-motion-reactjs-template
vite-antd-motion-reactjs-template
master

搜索帮助