打包配置

This commit is contained in:
zhangguoping 2024-09-03 11:06:13 +08:00
parent e574bfff15
commit 348867cf23
3 changed files with 5 additions and 2 deletions

View File

@ -3,6 +3,9 @@ const baseConfig = require('./webpack.base.js')
module.exports = merge(baseConfig, {
mode: 'production', // 生产模式,会开启 tree-shaking 和 压缩代码,以及其他优化
output: {
publicPath: './',
},
optimization: {
splitChunks: { // 分隔代码
cacheGroups: {

View File

@ -60,7 +60,7 @@ const routePage = [
const routes = [...routePublic, ...routeTemplate, ...routePage];
const router = createRouter({
history: createWebHistory(),
history: createWebHistory('/yxh5/'),
routes,
});

View File

@ -6,7 +6,7 @@ const defaultConfig: any = {
VITE_LOGIN_PATH: '',
},
'production': {
VITE_BASE_API: '/adminyx',
VITE_BASE_API: '/yxh5api',
VITE_LOGIN_PATH: '',
}
}