1 Star 2 Fork 1

wilsunson/yx-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
const path = require('path')
const port = 9527 // dev port
module.exports = {
publicPath:
process.env.NODE_ENV === 'production'
? '/vue-typescript-admin-template/'
: '/',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
// change xxx-api/login => mock/login
// detail: https://cli.vuejs.org/config/#devserver-proxy
// [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:${port}/mock`,
// changeOrigin: true,
// pathRewrite: {
// ['^' + process.env.VUE_APP_BASE_API]: ''
// }
// }
'/v1': {
target: 'http://118.89.50.76:9527',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/v1': ''
}
}
}
},
pwa: {
name: 'vue-typescript-admin-template'
},
chainWebpack(config) {
// https://webpack.js.org/configuration/devtool/#development
config.when(process.env.NODE_ENV === 'development', config =>
config.devtool('cheap-source-map')
)
config.when(process.env.NODE_ENV !== 'development', config => {
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: path.join(__dirname, 'src/components'),
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wilsunson/yx-admin.git
[email protected]:wilsunson/yx-admin.git
wilsunson
yx-admin
yx-admin
master

搜索帮助