Skip to content
js
module.exports = {
  chainWebpack (config) {
    // npm i compression-webpack-plugin@6.0.0
    chainWebpack (config) {
      config
        .plugin('CompressionPlugin')
        .use('compression-webpack-plugin', [
          {
            filename: '[path][base].br',
            test: /\.(js|css|html)$/,
            threshold: 10240, 
            algorithm: 'brotliCompress', 
            minRatio: 0.8,
          }
        ])
        .end()
    },
  }
}