-
Notifications
You must be signed in to change notification settings - Fork 14
/
vite.config.ts
44 lines (43 loc) · 1022 Bytes
/
vite.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
import { defineConfig } from "vite";
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import copy from "rollup-plugin-copy";
import styleImport from "vite-plugin-style-import"
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
"@": resolve(__dirname, "src"),
},
},
plugins: [
styleImport({
libs: [
{
libraryName: "antd",
esModule: true,
resolveStyle: (name) => `antd/es/${name}/style/css`,
},
],
}),
react(),
copy({
targets: [
{ src: "src/manifest.json", dest: "dist" },
{ src: "src/assets", dest: "dist" },
],
hook: "writeBundle",
}),
],
build: {
rollupOptions: {
input: ["index.html", "src/background.ts", "src/contentScript.ts"],
output: {
chunkFileNames: "[name].[hash].js",
assetFileNames: "[name].[hash].[ext]",
entryFileNames: "[name].js",
dir: "dist",
}
},
},
});