Skip to content

Commit

Permalink
perf: compress bundle js
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Feb 24, 2023
1 parent dca81e8 commit 5ffac2b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 79 deletions.
8 changes: 7 additions & 1 deletion client/web/build/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { buildWorkboxPlugin } from './workbox';
import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin';
import GenerateJsonPlugin from 'generate-json-webpack-plugin';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';

// eslint-disable-next-line @typescript-eslint/no-var-requires
require('dotenv').config();
Expand Down Expand Up @@ -241,7 +242,12 @@ const config: Configuration = {
},
optimization: {
splitChunks,
minimizer: [new CssMinimizerPlugin()],
minimizer: [
new CssMinimizerPlugin(),
new TerserPlugin({
minify: TerserPlugin.esbuildMinify,
}),
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.css'],
Expand Down
1 change: 1 addition & 0 deletions client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"source-ref-loader": "^1.0.7",
"style-loader": "^3.3.1",
"tailchat-plugin-declaration-generator": "workspace:^1.0.0",
"terser-webpack-plugin": "^5.3.6",
"ts-jest": "27.1.4",
"ts-node": "^10.9.1",
"tsconfig-paths": "^3.14.1",
Expand Down
Loading

0 comments on commit 5ffac2b

Please sign in to comment.