-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
38 lines (34 loc) · 944 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
35
36
37
38
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import buildContentScript from "./build-content-script";
const srcRoot = resolve(__dirname, "src")
const publicDir = resolve(__dirname, "public")
const outDir = resolve(__dirname, "dist")
// Use vite build --watch or nodemon??
export default defineConfig({
// esbuild: {
// drop: ['console', 'debugger']
// },
resolve: {
alias: {
"@common": resolve(srcRoot, "common"),
},
},
plugins: [react(), buildContentScript()],
publicDir,
build: {
outDir,
// think about emptyOutDir
emptyOutDir: false,
// sourcemap: false,
rollupOptions: {
input: {
"background": resolve(srcRoot, "background", "background.ts"),
},
output: {
entryFileNames: (chunk) => `${chunk.name}/${chunk.name}.js`,
},
},
}
})