related codes
const CompressionPlugin = require ("compression-webpack-plugin")
webpackConfig.plugins.push (
)new CompressionPlugin({
// asset: "[path].gz[query]",
algorithm: "gzip",
test: new RegExp(
"\\.(js)$"
// "\\.(" +
// configItem.productionGzipExtensions.join("|") +
// ")$"
),
threshold: 10240,
minRatio: 0.8
})
errors are as follows
compiler.hooks.emit.tapAsync ({name: "CompressionPlugin"}, emit);
) ^
TypeError: Cannot read property "emit" of undefined
at CompressionPlugin.apply (C:\MyWayProject\2018\vue\ehrAdmin\node_modules\compression-webpack-plugin\dist\index.js:175:20)