-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 1.04 KB
/
Copy pathvite.config.ts
File metadata and controls
32 lines (31 loc) · 1.04 KB
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 { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import chromeExtensionPlugin from "./vite-plugin-chrome-extension";
export default defineConfig({
plugins: [react(), chromeExtensionPlugin({ outDir: "dist" })],
base: "./",
build: {
outDir: "dist",
emptyOutDir: true,
rollupOptions: {
input: {
popup: resolve(__dirname, "src/app/popup/index.html"),
options: resolve(__dirname, "src/app/options/index.html"),
welcome: resolve(__dirname, "src/app/welcome/index.html"),
background: resolve(__dirname, "src/scripts/background/index.ts"),
content: resolve(__dirname, "src/scripts/content/index.ts"),
},
output: {
entryFileNames: (chunk) => {
if (["background", "content"].includes(chunk.name ?? "")) {
return "[name].js";
}
return "assets/[name].js";
},
chunkFileNames: "assets/chunks/[name].js",
assetFileNames: "assets/[name][extname]",
},
},
},
});