-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.app.config.ts
More file actions
32 lines (30 loc) · 822 Bytes
/
vite.app.config.ts
File metadata and controls
32 lines (30 loc) · 822 Bytes
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
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = resolve(__dirname, "src");
export default defineConfig(({ mode }) => ({
root,
publicDir: false,
resolve: {
alias: {
"@": root
}
},
build: {
outDir: resolve(__dirname, "dist", mode),
emptyOutDir: true,
sourcemap: !process.env.RELEASE,
rollupOptions: {
input: {
background: resolve(root, "background/service-worker.ts"),
settings: resolve(root, "settings/settings.html")
},
output: {
entryFileNames: "[name].js",
chunkFileNames: "chunks/[name]-[hash].js",
assetFileNames: "assets/[name]-[hash][extname]"
}
}
}
}));