diff --git a/vue.config.js b/vue.config.js index 763528e..365a2bc 100644 --- a/vue.config.js +++ b/vue.config.js @@ -51,26 +51,28 @@ module.exports = { return args; }); - config.module - .rule("images") - .test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i) - .use("image-webpack-loader") - .loader("image-webpack-loader") - .tap((options) => { - const newOpts = { - mozjpeg: { - progressive: true, - quality: 75, - }, - pngquant: { - quality: [0.65, 0.9], - speed: 4, - }, - gifsicle: { - interlaced: false, - }, - }; - return { ...options, ...newOpts }; - }); + if (process.env.NODE_ENV === "production") { + config.module + .rule("images") + .test(/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i) + .use("image-webpack-loader") + .loader("image-webpack-loader") + .tap((options) => { + const newOpts = { + mozjpeg: { + progressive: true, + quality: 75, + }, + pngquant: { + quality: [0.65, 0.9], + speed: 4, + }, + gifsicle: { + interlaced: false, + }, + }; + return { ...options, ...newOpts }; + }); + } }, };