-
Notifications
You must be signed in to change notification settings - Fork 60
/
vite.web.config.js
48 lines (47 loc) · 981 Bytes
/
vite.web.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { defineConfig } from "vite";
import path from "path";
import vitePluginImp from "vite-plugin-imp";
const resolve = (url) => path.resolve(__dirname, url);
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vitePluginImp({
libList: [
{
libName: "three",
libDirectory: "src",
camel2DashComponentName: false,
},
],
}),
],
css: {
modules: {
generateScopedName: "[name]__[local]__[hash:5]",
},
preprocessorOptions: {
less: {
// 支持内联 javascript
javascriptEnabled: true,
},
},
},
// 入口
build: {
outDir: "www",
rollupOptions: {
input: {
main: resolve("index.html"),
},
},
minify: "terser",
terserOptions: {
compress: {
//生产环境时移除console
drop_console: true,
drop_debugger: true,
},
},
},
base: "/", // 公共基础路径
});