diff --git a/packages/mindplot/package.json b/packages/mindplot/package.json index c46706f5..f6948183 100644 --- a/packages/mindplot/package.json +++ b/packages/mindplot/package.json @@ -1,6 +1,6 @@ { "name": "@wisemapping/mindplot", - "version": "0.4.0", + "version": "0.4.1", "description": "WiseMapping - Mindplot Canvas Library", "homepage": "http://www.wisemapping.org/", "main": "dist/main.js", @@ -42,6 +42,7 @@ "@babel/register": "^7.16.0", "babel-loader": "^8.2.2", "clean-webpack-plugin": "^4.0.0-alpha.0", + "compression-webpack-plugin": "^9.2.0", "copy-webpack-plugin": "^10.0.0", "core-js": "^3.15.2", "cypress": "^8.4.1", diff --git a/packages/mindplot/webpack.prod.js b/packages/mindplot/webpack.prod.js index 3a363f3f..f87d1b66 100644 --- a/packages/mindplot/webpack.prod.js +++ b/packages/mindplot/webpack.prod.js @@ -1,15 +1,22 @@ const { merge } = require('webpack-merge'); +const CompressionPlugin = require('compression-webpack-plugin'); const common = require('./webpack.common'); const prodConfig = { mode: 'production', devtool: 'source-map', optimization: { + minimize: true, splitChunks: { chunks: 'all', minSize: 2000000, }, }, + plugins: [ + new CompressionPlugin({ + test: /\.js(\?.*)?$/i + }), + ], }; module.exports = merge(common, prodConfig);