-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathvite.extension.config.ts
49 lines (46 loc) · 1.16 KB
/
vite.extension.config.ts
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
44
45
46
47
48
49
import { fileURLToPath, URL } from "node:url"
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import webExtension from "@samrum/vite-plugin-web-extension"
import manifest from "./extension/manifest"
const isNotProd = () => process.env.NODE_ENV != "production"
// https://vitejs.dev/config/
export default defineConfig({
define: {
__VUE_PROD_DEVTOOLS__: isNotProd(),
__DEBUBGBAR_MODE__: "extension",
},
plugins: [
vue({
template: {
compilerOptions: {
// This is because I embed the ruby logo SVG as a vue component.
// There is probably a better way.
isCustomElement: (tag) => tag.includes(":"),
},
},
}),
webExtension({
manifest,
}),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
manifest: false,
sourcemap: isNotProd(),
emptyOutDir: true,
outDir: "./dist-extension",
rollupOptions: {
// output: {
// inlineDynamicImports: true,
// },
input: {
devpanel: fileURLToPath(new URL("./src/devtools-panel.ts", import.meta.url)),
},
},
},
})