12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- const { defineConfig } = require('@vue/cli-service')
- module.exports = defineConfig({
- transpileDependencies: true,
- lintOnSave:false,
- publicPath: "./", // 公共路径(必须有的)
- outputDir: "bigData", // 输出文件目录
- assetsDir: "static", //静态资源文件名称
- productionSourceMap: false, //去除打包后js的map文件
- devServer: { //启动项目在8080端口自动打开
- host:"127.0.0.1",
- open: true,
- port: 30000,
- //proxy: null,
- proxy: process.env.VUE_APP_ENV === 'production' ? 'https://www.aaa.com/' : 'https://gateway.bbb.com/'
- },
- chainWebpack(config) {
- config
- .when(process.env.VUE_APP_ENV !== 'www.dlc.com',
- config => {
- config
- .plugin('ScriptExtHtmlWebpackPlugin')
- .after('html')
- .use('script-ext-html-webpack-plugin', [{
- // `runtime` must same as runtimeChunk name. default is `runtime`
- inline: /runtime\..*\.js$/
- }])
- .end()
- config
- .optimization.splitChunks({
- chunks: 'all',
- minSize: 50000, //构建出来的chunk大于30000才会被分割
- maxSize: 100000, //会尝试根据这个大小进行代码分割
- })
- }
- )
- },
- })
|