generated from Juniper1106/figma-plugin-testOnly
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ui.ts
33 lines (32 loc) · 902 Bytes
/
vite.config.ui.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
import { defineConfig } from "vite";
import path from "node:path";
import { viteSingleFile } from "vite-plugin-singlefile";
import react from "@vitejs/plugin-react";
import richSvg from "vite-plugin-react-rich-svg";
import postcssUrl from "postcss-url";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [react(), richSvg(), viteSingleFile()],
root: path.resolve("src/ui"),
build: {
minify: mode === "production",
cssMinify: mode === "production",
sourcemap: mode !== "production" ? "inline" : false,
emptyOutDir: false,
outDir: path.resolve("dist"),
rollupOptions: {
input: path.resolve("src/ui/index.html"),
},
},
css: {
postcss: {
plugins: [postcssUrl({ url: "inline" })],
},
},
resolve: {
alias: {
"@common": path.resolve("src/common"),
"@ui": path.resolve("src/ui"),
},
},
}));