1. The project uses ivew-admin
2. The problem is that the js and css built in the script bulid:uat are not small files by chunk, but the js,css is chunk in build:production.
as shown in the figure:
bulid:uat
build:production
- the scripts for bulid:uat are: "build:uat": "cross-env NODE_ENV=uat vue-cli-service build",
"build:production": "vue-cli-service build",
4.vue.config.js is configured as follows:
module.exports = {
// Project deployment base
// By default we assume your app will be deployed at the root of a domain,
// e.g. https://www.my-app.com/
// If your app is deployed at a sub-path, you will need to specify that
// sub-path here. For example, if your app is deployed at
// https://www.foobar.com/my-app/
// then change this to "/my-app/"
baseUrl: BASE_URL,
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
// webpack
configureWebpack: config => {
let plugins = []
// if (process.env.NODE_ENV !== "development") {
config.plugins = [...config.plugins, ...plugins]
// }
},
chainWebpack: config => {
config.resolve.alias
.set("@", resolve("src")) // key,value.set("@@", resolve("src/components"))
.set("_c", resolve("src/components"))
.set("_conf", resolve("config"))
},
// .map
productionSourceMap: false,
// axiosbaseUrl ""
// devServer: {
// proxy: "http://management-test2.tuhuanjk.com"
// }
devServer: {
proxy: {
"/api": {
target: "",
changeOrigin: true
}
}
}
}
Please give me some guidance, the goal is to run bulid:uat, the same chunk,js and css files; thank you!