Answer the question
In order to leave comments, you need to log in
How to configure WebpackCompressionPlugin?
Hello, I made this vue.config.js
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: (config) => {
Object.assign(
config.plugins,
new CompressionWebpackPlugin({
test: /\.js(\?.*)?$/i,
include: undefined,
exclude: undefined,
algorithm: "gzip",
compressionOptions: { level: 9 },
threshold: 0,
minRatio: 0.8,
filename: "[path][base].gz",
deleteOriginalAssets: false,
})
);
},
});
vue inspect
indicates that the compressionWebpackPlugin plugin is not initialized, which I did wrong...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question