-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathvite.config.chrome.ts
More file actions
32 lines (30 loc) · 965 Bytes
/
vite.config.chrome.ts
File metadata and controls
32 lines (30 loc) · 965 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 { resolve } from "path";
import { mergeConfig, defineConfig } from "vite";
import { crx, ManifestV3Export } from "@crxjs/vite-plugin";
import baseConfig, { baseManifest, baseBuildOptions, bundleInPageScriptPlugin } from "./vite.config.base";
const outDir = resolve(__dirname, "dist_chrome");
export default mergeConfig(
baseConfig,
defineConfig({
plugins: [
crx({
manifest: {
...baseManifest,
background: {
service_worker: "src/pages/background/index.ts",
type: "module",
},
} as ManifestV3Export,
browser: "chrome",
contentScripts: {
injectCss: true,
},
}),
bundleInPageScriptPlugin(outDir),
],
build: {
...baseBuildOptions,
outDir,
},
}),
);