-
Notifications
You must be signed in to change notification settings - Fork 11
/
vite.config.js
43 lines (41 loc) · 1.26 KB
/
vite.config.js
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
34
35
36
37
38
39
40
41
42
43
import { defineConfig, loadEnv } from "vite";
import webExtension, { readJsonFile } from "vite-plugin-web-extension";
function generateManifest() {
const manifest = readJsonFile("src/manifest.json");
const pkg = readJsonFile("package.json");
return {
version: pkg.version.split("-")[0],
...manifest
};
}
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, ".");
return {
plugins: [
webExtension({
manifest: generateManifest,
watchFilePaths: ["package.json", "src/manifest.json"],
browser: env.VITE_TARGET_BROWSER || "chrome",
webExtConfig: {
startUrl: [
"https://www.youtube.com/playlist?list=PLAhTBeRe8IhMmRve_rSfAgL_dtEXkKh8Z",
"https://www.youtube.com/playlist?list=PLrtg3MOb7tvG9h9rll5V9O96owfcBpROG",
"https://www.youtube.com/playlist?list=PLBsP89CPrMePWBCMIp0naluIz67UwRX9B",
"https://www.youtube.com/playlist?list=PLBsP89CPrMeM2MmF4suOeT0vsic9nEC2Y",
"https://www.youtube.com/playlist?list=PL3HWFB6aFvWBXGsbVJhJJK1ykcqlVz5lI"
]
}
})
],
build: {
sourcemap: "inline",
outDir: "dist",
emptyOutDir: true
},
resolve: {
alias: {
src: "/src"
}
}
};
});