Skip to content

Commit

Permalink
perf: add webpack-retry-chunk-load-plugin to fix chunk load failed error
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Dec 23, 2022
1 parent f8765d1 commit 4dc9e0b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions client/web/build/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import dayjs from 'dayjs';
import { BundleStatsWebpackPlugin } from 'bundle-stats-webpack-plugin';
import { WebpackStatsViewerPlugin } from 'webpack-stats-viewer-plugin';
import { buildWorkboxPlugin } from './workbox';
import { RetryChunkLoadPlugin } from 'webpack-retry-chunk-load-plugin';

// eslint-disable-next-line @typescript-eslint/no-var-requires
require('dotenv').config();
Expand Down Expand Up @@ -91,6 +92,9 @@ const plugins: Configuration['plugins'] = [
],
}) as any,
new MiniCssExtractPlugin({ filename: 'styles-[contenthash].css' }),
new RetryChunkLoadPlugin({
maxRetries: 2,
}),
buildWorkboxPlugin(isDev),
new WebpackBar({
name: `Tailchat`,
Expand Down
1 change: 1 addition & 0 deletions client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
"webpack-bundle-analyzer": "^4.7.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.11.1",
"webpack-retry-chunk-load-plugin": "^3.1.1",
"webpack-stats-viewer-plugin": "1.0.2",
"webpackbar": "^5.0.2",
"workbox-webpack-plugin": "^6.5.4"
Expand Down
17 changes: 14 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4dc9e0b

Please sign in to comment.