Commit bbb0fdb7 by 杨明

配置

1 parent 8a4f15c2
......@@ -2,12 +2,11 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-07-22 18:15:13
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-07-21 17:42:38
* @LastEditTime: 2023-07-24 13:51:47
* @FilePath: \scrm-micro-home\vue.config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const path = require('path')
const PreloadWebpackPlugin = require('@vue/preload-webpack-plugin')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
......@@ -54,20 +53,25 @@ module.exports = {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
module: {
rules: [
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ['url-loader']
}
]
},
chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugin('preload').use(PreloadWebpackPlugin, [
{
rel: 'preload',
include: 'allAssets',
fileBlacklist: [/\.map$/, /hot-update\.js$/]
}
])
// config.plugins.delete('preload') // TODO: need test
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!