const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: config => {
    config
      .plugin('gzip-plugin')
      .use('compression-webpack-plugin', [
        {
          filename: '[path][base].gz',
          algorithm: 'gzip',
          test: /\.js$|\.html$|\.json$|\.css$|\.ttf$/,
          threshold: 102400, // 只有大小大于该值的资源会被处理100KB =100 * 1024
          deleteOriginalAssets: false // 删除原文件
        }
      ])
      .end()
  },
  devServer: {
    port: 8082,
    host: '',
    proxy: {
      '/api': {
        target: 'http://172.16.17.222:8096',
        changeOrigin: true
        // pathRewrite: {
        //   '^/api': '',
        // },
      }
    }
  }
})

