-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
56 lines (49 loc) · 1.16 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
46
47
48
49
50
51
52
53
54
55
56
import { resolve } from "path";
import { defineConfig, loadEnv } from "vite";
import Vue from "@vitejs/plugin-vue";
import Components from "unplugin-vue-components/vite";
const root = "src";
const envPrefix = ["VITE_", "KIRBY_"];
export default defineConfig(({ mode }) => {
Object.assign(process.env, loadEnv(mode, process.cwd(), envPrefix));
return defineConfig({
root,
base: mode === "development" ? "/" : "/dist/",
envPrefix,
css: {
preprocessorOptions: {
scss: {
additionalData:
`@import "` +
resolve(__dirname, "public/assets") +
`/scss/_variables.scss";`,
},
},
},
resolve: {
alias: {
"~/": `${resolve(__dirname, root)}/`,
},
},
build: {
outDir: resolve(__dirname, "public/dist"),
emptyOutDir: true,
manifest: true,
rollupOptions: {
input: resolve(root, "main.js"),
},
},
plugins: [
Vue(),
Components({
dirs: ["components"],
}),
],
server: {
cors: true,
host: "0.0.0.0",
port: process.env.VITE_DEV_PORT,
strictPort: true,
},
});
});