-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
vite.config.base.ts
48 lines (37 loc) · 1.29 KB
/
vite.config.base.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
import {resolve} from "path";
import vue from "@vitejs/plugin-vue";
import {type UserConfig} from "vite";
const rel = (p: string) => resolve(__dirname, p);
const prod = process.env.NODE_ENV === "production";
// https://vitejs.dev/config/
export default {
root: "src",
publicDir: "assets",
clearScreen: false,
plugins: [vue({isProduction: prod})],
resolve: {
// Disable extension resolution since it's not what ES modules do
extensions: [],
},
build: {
outDir: rel("dist"),
emptyOutDir: false,
// We don't emit source maps in production to reduce build size, and because
// they are often not reliable for reasons I'm never able to figure out.
sourcemap: !prod,
// We never minify (even in production) because it produces more
// reliable stack traces with actual names for functions.
minify: false,
// Remove the hash from the generated file names, because it (and ONLY it;
// the content is the same even though it's supposedly a "content hash")
// seems to be inconsistent from build to build depending on the path to the
// build tree.
rollupOptions: {
output: {
assetFileNames: "assets/[name].[ext]",
chunkFileNames: "assets/[name].js",
entryFileNames: "[name].js",
},
},
},
} as UserConfig;