Skip to content

Commit

Permalink
feat: compress static assets for production MARS-429
Browse files Browse the repository at this point in the history
  • Loading branch information
emuvente committed Sep 11, 2023
1 parent 8a5657f commit 08896ee
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const FilterWarningsPlugin = require('webpack-filter-warnings-plugin');
const webpack = require('webpack');
const CompressionPlugin = require('compression-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin-fixed-hashbug');
const gitRevisionPlugin = new GitRevisionPlugin({
Expand Down Expand Up @@ -331,5 +332,14 @@ module.exports = {
sizeThreshold: 500 * 1024 * 1024
}
})]),
...(isProd ? [
// gzip compression
new CompressionPlugin(),
// brotli compression
new CompressionPlugin({
filename: "[path][base].br",
algorithm: "brotliCompress",
}),
] : []),
]
};

0 comments on commit 08896ee

Please sign in to comment.