diff --git a/webpack.base.js b/webpack.base.js index b5c8d74..42918ce 100644 --- a/webpack.base.js +++ b/webpack.base.js @@ -3,7 +3,6 @@ const fs = require('fs'); const marked = require('marked'); const CopyPlugin = require('copy-webpack-plugin'); -// const CompressionPlugin = require("compression-webpack-plugin") const renderer = new marked.Renderer() renderer.link = (href, title, text) => { @@ -144,14 +143,7 @@ module.exports = { {from: 'assets/icons', to: 'assets/icons'}, {from: 'assets/images', to: 'assets/images'}, {from: 'assets/theme', to: 'assets/theme'} - ]}), - // new CompressionPlugin( - // { - // filename: "[path].gz[query]", - // algorithm: "gzip", - // test: [/\.js/, /\.svg/], - // threshold: 1000 - // }) + ]}) ], output: { diff --git a/webpack.prod.js b/webpack.prod.js index 9449d21..c82d5eb 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,6 +1,9 @@ const webpack = require('webpack'); const config = require('./webpack.base.js'); +const CompressionPlugin = require("compression-webpack-plugin") + + module.exports = Object.assign( config, { @@ -16,6 +19,12 @@ module.exports = Object.assign( { 'DEBUG': false } // set a DEBUG flag that can be used in the scripts (can be skipped) + }), + new CompressionPlugin( + { + algorithm: "gzip", + test: [/\.js$/, /\.svg$/], + threshold: 1000 }) ]) }