-
Notifications
You must be signed in to change notification settings - Fork 41
/
vite.config.background.ts
40 lines (39 loc) · 1.18 KB
/
vite.config.background.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
import { defineConfig } from "vite";
import { sharedConfig } from "./vite.config";
import { isBeta, isDev, r } from "./scripts/utils";
import packageJson from "./package.json";
// bundling the content script using Vite
export default defineConfig({
...sharedConfig,
define: {
"__DEV__": isDev,
// https://github.com/vitejs/vite/issues/9320
// https://github.com/vitejs/vite/issues/9186
"process.env.NODE_ENV": JSON.stringify(isDev ? "development" : "production")
},
build: {
// FF devtools never updates sources or deployed files after extension is reloaded
// - MUST MANUALLY RESTART DEVTOOLS EVERY TIME!
// https://bugzilla.mozilla.org/show_bug.cgi?id=1437937 may be a problem but unsure
watch: isDev
? {}
: undefined,
outDir: r("extension/dist/background"),
cssCodeSplit: false,
emptyOutDir: false,
sourcemap: true, // (isDev || isBeta) ? "inline" : false,
lib: {
entry: r("src/background/main.ts"),
name: packageJson.name,
formats: ["es"]
},
rollupOptions: {
output: {
entryFileNames: "index.js",
extend: true
}
},
reportCompressedSize: false,
minify: false
}
});