const CompressionWebpackPlugin = require('compression-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");

module.exports = {
  devServer: {
    proxy: {
      "/proxyApi": {
        target: 'http://172.16.101.87:34568',
        pathRewrite: {
          '^/proxyApi': '',
        },
      },
    },
  },
  configureWebpack: {
    optimization: {
      minimize: true,
      minimizer: [new TerserPlugin()],
    },
    plugins: [
      new CompressionWebpackPlugin(),
    ],
  },
  chainWebpack: config => {
    /* svg */
    const svgRule = config.module.rule("svg");
    svgRule.uses.clear();
    svgRule
      .use("svg-sprite-loader")
      .loader("svg-sprite-loader")
      .options({
        symbolId: "icon-[name]"
      })
      .end();
  
  }
}
