Add compression pluggin

This commit is contained in:
Paulo Gustavo Veiga 2021-12-21 20:38:13 -08:00
parent 549dfed708
commit b29b75931e
2 changed files with 9 additions and 1 deletions

View File

@ -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",

View File

@ -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);