加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
寒夜梦未央 提交于 2022-02-14 15:20 . first commit
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'
}
}
}
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化