-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
44 lines (43 loc) · 1.22 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
import react from "@vitejs/plugin-react-swc";
import { resolve } from "path";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
resolve: {
alias: [
{
find: "@",
replacement: resolve(__dirname, "src"),
},
],
},
build: {
outDir: "dist",
assetsDir: "assets",
rollupOptions: {
input: {
background: resolve(__dirname, "src/background"),
homepage: resolve(__dirname, "src/content/homepage.ts"),
recorder: resolve(__dirname, "src/content/recorder.ts"),
homepage_inject: resolve(__dirname, "src/style/homepage_inject.css"),
popupPage: resolve(__dirname, "html/popup.html"),
recordPage: resolve(__dirname, "html/record.html"),
},
output: {
entryFileNames: "js/[name].js",
assetFileNames: (chunkInfo) => {
if (chunkInfo.name.endsWith(".css")) {
return "css/[name][extname]";
}
return "[ext]/[name][extname]";
},
manualChunks: {
react: ["react", "react-dom"],
recharts: ["recharts"],
iconify: ["@iconify/react"],
},
chunkFileNames: "js/lib/[name]-[hash].js",
},
},
},
});