forked from baptistecdr/aria2-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
35 lines (32 loc) · 1.01 KB
/
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
import { resolve } from "path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import tsconfigPaths from "vite-tsconfig-paths";
const r = (...args: string[]) => resolve(__dirname, ...args);
const minify = process.env.NODE_ENV === "production" ? "esbuild" : false;
const cssMinify = process.env.NODE_ENV === "production" ? "esbuild" : false;
// https://vitejs.dev/config/
export default defineConfig({
root: r("src"),
publicDir: r("public"),
build: {
target: "ES2022",
cssMinify,
minify,
rollupOptions: {
input: {
background: r("src/background/background.ts"),
options: r("src/options/options.html"),
popup: r("src/popup/popup.html"),
},
output: {
dir: r("dist"),
entryFileNames: "js/[name].js",
chunkFileNames: "js/[name].js",
assetFileNames: "media/[name].[ext]",
},
},
},
plugins: [react(), nodePolyfills(), tsconfigPaths()],
});