-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
46 lines (42 loc) · 1.06 KB
/
vite.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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// legacy
import legacy from "@vitejs/plugin-legacy";
import viteCompression from "vite-plugin-compression";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
viteCompression({
// gzip静态资源压缩配置
verbose: true,
disable: false,
threshold: 10240,
algorithm: "gzip",
ext: ".gz",
}),
legacy({
targets: ["Chrome 70"],
// targets: ["defaults", "not IE 11"],
modernPolyfills: true,
}),
],
base: "./", // index.html文件所在位置
root: "./", // js导入的资源路径
server: {
// 代理
// proxy,
host: "0.0.0.0",
fs: {
strict: false,
},
},
build: {
outDir: "filePreview",
// target: ["chrome70"],
// cssTarget: ["chrome64"],
minify: "esbuild", // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest: false, // 是否产出maifest.json
sourcemap: false, // 是否产出soucemap.jso
},
});