1 Star 0 Fork 54

mark/arco-work

forked from 清清玄/arco-work 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
jxl 提交于 2022-05-03 21:05 . feats: jsx
import vue from '@vitejs/plugin-vue'
import viteSvgIcons from 'vite-plugin-svg-icons'
import path from 'path'
import { defineConfig } from 'vite'
import dotenv from 'dotenv'
import vueJsx from '@vitejs/plugin-vue-jsx'
// 在正式打包的时候,可以把这两行代码放开
// import Components from 'unplugin-vue-components/vite'
// import { ArcoResolver } from 'unplugin-vue-components/resolvers'
export default defineConfig(({ mode }) => {
const dotenvConfig = dotenv.config({ path: `./.env.${mode}` })
const dotenvObj = dotenvConfig.parsed
return {
base: dotenvObj.BUILD_PATH,
build: {
outDir: dotenvObj.BUILD_OUT_DIR || 'dist',
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString()
}
},
},
},
},
plugins: [
vue(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'icon-[dir]-[name]',
}),
vueJsx(),
// 在正式打包的时候,可以把这三行代码放开
// Components({
// resolvers: [ArcoResolver()],
// }),
],
css: {
preprocessorOptions: {
less: {
additionalData: `@import "src/styles/variables.less";`,
modifyVars: {},
javascriptEnabled: true,
},
},
},
resolve: {
alias: [
{
find: '@/',
replacement: path.resolve(process.cwd(), 'src') + '/',
},
],
},
server: {
open: true,
},
// optimizeDeps: {
// include: [
// 'vue',
// 'lodash',
// '@arco-design/web-vue',
// '@arco-design/web-vue/es/icon',
// 'pinia',
// 'vue-router',
// ],
// },
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ptn/arco-work.git
git@gitee.com:ptn/arco-work.git
ptn
arco-work
arco-work
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385