forked from CoconutGoodie/figma-plugin-react-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.plugin.ts
35 lines (34 loc) · 879 Bytes
/
vite.config.plugin.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 path from "node:path";
import { defineConfig } from "vite";
import generateFile from "vite-plugin-generate-file";
import { viteSingleFile } from "vite-plugin-singlefile";
import figmaManifest from "./figma.manifest";
export default defineConfig(({ mode }) => ({
plugins: [
viteSingleFile(),
generateFile({
type: "json",
output: "./manifest.json",
data: figmaManifest,
}),
],
build: {
minify: mode === 'production',
sourcemap: mode !== 'production' ? 'inline' : false,
target: 'es2017',
emptyOutDir: false,
outDir: path.resolve("dist"),
rollupOptions: {
input: path.resolve('src/plugin/plugin.ts'),
output: {
entryFileNames: 'plugin.js',
},
},
},
resolve: {
alias: {
"@common": path.resolve("src/common"),
"@plugin": path.resolve("src/plugin"),
},
},
}));