123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- const CompressionPlugin = require("compression-webpack-plugin");
- const webpack = require("webpack");
- const BundleAnalyzerPlugin =
- require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
- module.exports = {
- publicPath: process.env.NODE_ENV === "production" ? "" : "/",
- productionSourceMap: false,
- lintOnSave: false,
- chainWebpack: (config) => {
- if (process.env.NODE_ENV === "production") {
- if (process.env.npm_config_report) {
- config
- .plugin("webpack-bundle-analyzer")
- .use(
- require("webpack-bundle-analyzer").BundleAnalyzerPlugin
- );
- }
- config.plugins.delete("prefetch");
- }
- },
- configureWebpack: (config) => {
- if (process.env.NODE_ENV === "production") {
- config.optimization = {
- splitChunks: {
- chunks: "all",
- minSize: 10000,
-
-
-
- automaticNameDelimiter: "-",
-
- cacheGroups: {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- },
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- },
- parallel: true,
- devServer: {
- proxy: {
-
- "/market/CMK": {
- <<<<<<< HEAD
- target: "http://43.138.50.94:9600",
- =======
- target: "http://192.168.2.124:9113",
- >>>>>>> 994fc041f082ba5e33229f3e58f7c4b6c7b355c4
- ws: false,
- changeOrigin: true,
- pathRewrite: {
- "^/market": "",
- },
- },
- "/market/mk": {
- <<<<<<< HEAD
- target: "http://43.138.50.94:9600",
- =======
- target: "http://192.168.2.124:9113",
- >>>>>>> 994fc041f082ba5e33229f3e58f7c4b6c7b355c4
- ws: false,
- changeOrigin: true,
- pathRewrite: {
- "^/market": "",
- },
- },
- "/market/techcentergj": {
- <<<<<<< HEAD
- target: "http://43.138.50.94:9600",
- =======
- target: "http://192.168.2.124:9113",
- >>>>>>> 994fc041f082ba5e33229f3e58f7c4b6c7b355c4
- ws: false,
- changeOrigin: true,
- pathRewrite: {
- "^/market": "",
- },
- },
- "/mkWangge": {
- target: "http://192.168.2.124:9113",
- ws: false,
- changeOrigin: true,
- pathRewrite: {
- "^/market": "",
- },
- },
- "/api": {
- target: "http://43.138.50.94:7777",
- ws: false,
- changeOrigin: true,
- pathRewrite: {
- "^/api": "",
- },
- },
- // 开发环境变化可注释 ⬆️⬆️
- "/": {
- // target: 'http://192.168.2.145:9600/spfm',
- // target: 'http://192.168.2.149:9600',
- // target: 'http://10.64.42.70:8088/',
- // target: 'http://114.215.71.182:29600',
- // target: 'http://192.168.1.9:9600/spfm',
- // target: 'http://127.0.0.1:9600/',
- // target: 'http://192.168.0.156:9600/',
- // target: 'http://192.168.2.44:9600/',
- target: 'http://192.168.2.124:9600/',
- // target: "http://124.223.66.248:9600",
- // target: "http://43.138.50.94:9600",
- changeOrigin: true,
- },
- },
- },
- transpileDependencies: ["color-string"], // 此段为增加配置选项
- };
|