打包配置
This commit is contained in:
parent
e574bfff15
commit
348867cf23
|
@ -3,6 +3,9 @@ const baseConfig = require('./webpack.base.js')
|
|||
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'production', // 生产模式,会开启 tree-shaking 和 压缩代码,以及其他优化
|
||||
output: {
|
||||
publicPath: './',
|
||||
},
|
||||
optimization: {
|
||||
splitChunks: { // 分隔代码
|
||||
cacheGroups: {
|
||||
|
|
|
@ -60,7 +60,7 @@ const routePage = [
|
|||
const routes = [...routePublic, ...routeTemplate, ...routePage];
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
history: createWebHistory('/yxh5/'),
|
||||
routes,
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const defaultConfig: any = {
|
|||
VITE_LOGIN_PATH: '',
|
||||
},
|
||||
'production': {
|
||||
VITE_BASE_API: '/adminyx',
|
||||
VITE_BASE_API: '/yxh5api',
|
||||
VITE_LOGIN_PATH: '',
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue