loulijun2021
2023-05-19 dba0fdf9154af7d91de34aab02c7e70ba7d407eb
vue.config.js
@@ -53,8 +53,6 @@
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: 'http://121.196.36.24:8001', // 请求的第三⽅接⼝地址       本地开发服务器
        // target: 'http://192.168.2.138:8001', // 请求的第三⽅接⼝地址   客户服务器(大岛)
        // target: 'http://192.168.5.176:8001', // 请求的第三⽅接⼝地址   客户服务器(普登)
        changeOrigin: true, // 请求跨域时,需 配置此项
        pathRewrite: { // 路径重写,替换target中的请求地址
          ['^' + process.env.VUE_APP_BASE_API]: '/api/'
@@ -78,14 +76,14 @@
        jQuery: 'jquery',
        $: 'jquery'
      })
    ],
    ]
    // module: {
      // rules: [
      //   {
      //     test: /.vue$/,
      //     loader: 'vue-loader'
      //   }
      // ]
    // rules: [
    //   {
    //     test: /.vue$/,
    //     loader: 'vue-loader'
    //   }
    // ]
    // }
  },
  chainWebpack(config) {
@@ -133,28 +131,28 @@
            .end()
          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: resolve('src/components'), // can customize your rules
                minChunks: 3, //  minimum common number
                priority: 5,
                reuseExistingChunk: true
              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: resolve('src/components'), // can customize your rules
                  minChunks: 3, //  minimum common number
                  priority: 5,
                  reuseExistingChunk: true
                }
              }
            }
          })
            })
          // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
          config.optimization.runtimeChunk('single')
        }