-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
34 lines (32 loc) · 883 Bytes
/
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
import {BuildOptions, defineConfig} from "vite";
import minifyHTML from "rollup-plugin-minify-html-literals";
export default defineConfig(({ command, mode, isSsrBuild, isPreview }) => {
const rollupOptions: BuildOptions["rollupOptions"] = {
input: {
"app": "src/app.ts",
"browser-inject": "src/browser/inject.ts",
},
output: {
entryFileNames: `[name].js`,
}
};
if (mode === "production") {
return {
plugins: [
minifyHTML.default()
],
build: {
outDir: "build",
rollupOptions: rollupOptions
}
};
} else {
return {
build: {
minify: false,
outDir: "build",
rollupOptions: rollupOptions
}
};
}
});