forked from smellyshovel/vite-vue-starter-slave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.demo.config.ts
44 lines (36 loc) · 1 KB
/
vite.demo.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
// This config is used by the demo
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import { visualizer } from "rollup-plugin-visualizer";
import { resolve } from "path";
// https://vitejs.dev/config/
export default ({ mode }: { mode: string }) => {
// make all the Vite's env. variables available in this config file
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
plugins: [
vue(),
visualizer({
filename: "demo_stats.html",
}),
],
root: resolve(__dirname, "demo"),
resolve: {
// to be able to self-reference the lib in the demo
dedupe: ["vue"],
},
optimizeDeps: {
// TODO: use the slave's actual name (from package.json)
exclude: ["vite-vue-starter-slave"],
},
server: {
// allow the access to all the slaves' sourcemap files
fs: {
allow: [".."],
},
proxy: {
// demo server's proxy rules
},
},
});
};