This commit is contained in:
2023-03-20 17:28:07 +08:00
parent a7606b1f20
commit bff5199726
42 changed files with 5202 additions and 467 deletions

View File

@@ -35,20 +35,31 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`,
target: `http://vue.ruoyi.vip/prod-api/`,
target: `http://localhost:8086`,
// target: `http://vue.ruoyi.vip/prod-api/`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
},
"/amap": {
target: "https://restapi.amap.com",
changeOrigin: true,
ws: true,
pathRewrite: {
"^/amap": ""
}
}
},
disableHostCheck: true
},
css: {
loaderOptions: {
sass: {
sassOptions: { outputStyle: 'expanded' }
sassOptions: {
outputStyle: 'expanded'
}
}
}
},
@@ -59,6 +70,9 @@ module.exports = {
'@': resolve('src')
}
},
externals: {
AMap: "AMap"
},
plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({
@@ -92,12 +106,10 @@ module.exports = {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}
])
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end();
config.optimization.splitChunks({
chunks: 'all',
@@ -122,11 +134,10 @@ module.exports = {
}
}
});
config.optimization.runtimeChunk('single'),
{
from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './' // 到根目录下
};
config.optimization.runtimeChunk('single'), {
from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './' // 到根目录下
};
});
}
};