forked from iGoodie/figma-plugin-react-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ui.ts
More file actions
33 lines (32 loc) · 875 Bytes
/
vite.config.ui.ts
File metadata and controls
33 lines (32 loc) · 875 Bytes
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 tailwindcss from '@tailwindcss/vite';
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
plugins: [
react(),
richSvg(),
tailwindcss(),
viteSingleFile()
].filter(Boolean),
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')
}
},
resolve: {
alias: {
'@/common': path.resolve('src/common'),
'@/ui': path.resolve('src/ui')
}
}
}));