forked from smellyshovel/vite-vue-starter-master
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
49 lines (40 loc) · 1.1 KB
/
vite.config.ts
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
49
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import vitePluginHtmlEnv from "vite-plugin-html-env";
import { visualizer } from "rollup-plugin-visualizer";
// https://vitejs.dev/config/
export default ({ mode }) => {
// make all the Vite's env. variables available in this config file
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
plugins: [vitePluginHtmlEnv(), vue(), visualizer()],
resolve: {
// TODO: list all the direct slaves' peer dependencies
dedupe: ["vue"],
},
optimizeDeps: {
// TODO: list all the direct slaves
exclude: ["vite-vue-starter-slave"],
},
// TODO: uncomment to fix DX
// esbuild: {
// treeShaking: false,
// },
build: {
sourcemap: true,
// TODO: uncomment to fix DX
// rollupOptions: {
// treeshake: false,
// },
},
server: {
// allow the access to all the slaves' sourcemap files
fs: {
allow: [".."],
},
proxy: {
// dev server proxy rules
},
},
});
};