-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.chrome.ts
More file actions
33 lines (32 loc) · 913 Bytes
/
vite.config.chrome.ts
File metadata and controls
33 lines (32 loc) · 913 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
33
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [
react(),
viteStaticCopy({
targets: [
{
src: "./xmanifests/chrome/manifest.json",
dest: "",
},
],
}),
],
build: {
outDir: "dist/chrome",
rollupOptions: {
input: {
background: "src/background.ts",
popup: "popup.html",
// content-scripts are built separately because we don't want rollup to bundle them
// Rollup enforces code-splitting when there are multiple entry-points
// but content-scripts can't use import statements, everything need to be bundled into a single file
// "content-scripts": "src/content-script.ts",
},
output: {
entryFileNames: "[name].js",
},
},
},
});