-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
46 lines (45 loc) · 1.13 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
44
45
46
import { defineConfig } from "vite";
import { resolve } from "path";
import vue from "@vitejs/plugin-vue";
import copy from "rollup-plugin-copy";
import windiConfig from "./windi.config";
import WindiCSS from "vite-plugin-windicss";
export default defineConfig({
root: "src",
base: "/",
build: {
outDir: resolve(__dirname, "extension"),
// https://developer.chrome.com/docs/webstore/program_policies/#:~:text=Code%20Readability%20Requirements
terserOptions: {
mangle: false,
},
emptyOutDir: true,
rollupOptions: {
inlineDynamicImports: true,
input: {
background: resolve(__dirname, "src/background.ts"),
options: resolve(__dirname, "src/options/index.html"),
},
output: {
entryFileNames: "js/[name].js",
chunkFileNames: "js/[name].js",
},
},
},
optimizeDeps: {
include: ["vue"],
},
plugins: [
copy({
targets: [
{ src: "images", dest: "extension" },
{ src: "src/manifest.json", dest: "extension" },
],
hook: "writeBundle",
}),
vue(),
WindiCSS({
config: windiConfig,
}),
],
});