-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (52 loc) · 1.14 KB
/
vite.config.ts
File metadata and controls
53 lines (52 loc) · 1.14 KB
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
45
46
47
48
49
50
51
52
53
import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
import viteSvgIcons from 'vite-plugin-svg-icons'
import path from 'path'
export default defineConfig({
plugins: [
reactRefresh(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'svg-icon-[dir]-[name]'
})
],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true
}
}
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
base: './',
server: {
open: true,
cors: true,
host: true
},
build: {
emptyOutDir: true,
lib: {
entry: path.resolve(__dirname, 'src/core/index.ts'),
formats: ['es', 'umd'],
name: 'ReactFormCreate',
fileName: (format) => `react-form-create.${format}.js`
},
rollupOptions: {
external: ['react', 'react-dom', 'antd', 'moment', '@babel/standalone'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDom',
antd: 'antd',
moment: 'moment',
'@babel/standalone': 'Babel'
}
}
}
}
})