1 Star 0 Fork 21

MelodyJerry/vue-admin-work-a

forked from 清清玄/vue-admin-work-a 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
jxl 提交于 2022-03-21 21:19 . update vite-plugin-components
import vue from '@vitejs/plugin-vue'
import viteSvgIcons from 'vite-plugin-svg-icons'
import Components from 'unplugin-vue-components/vite'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
import path from 'path'
import { defineConfig } from 'vite'
import dotenv from 'dotenv'
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',
},
plugins: [
vue(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'icon-[dir]-[name]',
}),
Components({
resolvers: [AntDesignVueResolver()],
}),
],
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: [],
exclude: ['vue-demi'],
},
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/melodyjerry/vue-admin-work-a.git
git@gitee.com:melodyjerry/vue-admin-work-a.git
melodyjerry
vue-admin-work-a
vue-admin-work-a
master

搜索帮助