1 Star 2 Fork 1

wwl/vue3项目工程化模板项目

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
wwl 提交于 2022-08-12 15:11 . feat: 新增socket及hooks用法
import { UserConfigExport, ConfigEnv } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
import viteSvgIcons from 'vite-plugin-svg-icons'
import path from 'path'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default ({ command }: ConfigEnv): UserConfigExport => {
const prodMock = true
return {
base: '/',
publicDir: 'public',
// base: command === 'serve' ? '/' : '/vue3-element-admin-ts/',
plugins: [
vue(),
viteSvgIcons({
// 配置路径在你的publish里的svg存放文件
iconDirs: [path.resolve(process.cwd(), 'public/svgIcons')],
symbolId: 'icon-[dir]-[name]'
}),
AutoImport({
resolvers: [ElementPlusResolver()],
imports: ['vue']
}),
Components({
resolvers: [ElementPlusResolver()]
}),
VueSetupExtend()
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'#': path.resolve(__dirname, 'types')
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "./src/styles/variables.scss";`
}
}
},
server: {
host: '0.0.0.0',
port: 3000,
open: true
},
// server: {
// port: 3002,
// open: false,
// proxy: {
// '/api': {
// target: 'http://admin.xueyueob.cn/api',
// changeOrigin: true,
// ws: true,
// rewrite: (path) => path.replace(new RegExp('^/api'), '')
// }
// }
// },
build: {
// sourcemap: true,
manifest: true,
rollupOptions: {
output: {
manualChunks: {
vue: ['vue', 'vue-router', 'vuex'],
'element-plus': ['element-plus'],
echarts: ['echarts'],
xlsx: ['xlsx'],
'icons-vue': ['@element-plus/icons-vue']
}
}
},
chunkSizeWarningLimit: 500,
outDir: './dist/motolive.58moto.com'
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/wwlaaaa/vue3-vite-element-admin.git
[email protected]:wwlaaaa/vue3-vite-element-admin.git
wwlaaaa
vue3-vite-element-admin
vue3项目工程化模板项目
master

搜索帮助