-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.pages.ts
More file actions
31 lines (30 loc) · 889 Bytes
/
vite.config.pages.ts
File metadata and controls
31 lines (30 loc) · 889 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
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
// Build popup and options HTML pages (React apps).
// This is step 2 of the build — it does NOT clear the dist folder.
export default defineConfig({
plugins: [react()],
// Use relative paths so chrome-extension:// URLs work correctly
base: "",
build: {
outDir: "dist",
emptyOutDir: false, // preserve step 1 output
rollupOptions: {
input: {
popup: resolve(__dirname, "src/popup/index.html"),
options: resolve(__dirname, "src/options/index.html"),
},
output: {
entryFileNames: "assets/[name]-[hash].js",
chunkFileNames: "assets/[name]-[hash].js",
assetFileNames: "assets/[name]-[hash][extname]",
},
},
},
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
});