Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): limit the size of UMD build fragment as much as possible #2843

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions config/webpack/browser.config.babel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import path from 'path';
import webpack from 'webpack';
import { StatsWriterPlugin } from 'webpack-stats-plugin';
import { DuplicatesPlugin } from 'inspectpack/plugin';
import { WebpackBundleSizeAnalyzerPlugin } from 'webpack-bundle-size-analyzer';
Expand Down Expand Up @@ -45,20 +44,12 @@ const browser = {
module,
plugins: [
new LodashModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
}),
new DuplicatesPlugin({
// emit compilation warning or error? (Default: `false`)
emitErrors: false, // https://github.com/FormidableLabs/inspectpack/issues/181
// display full duplicates information? (Default: `false`)
verbose: true,
}),
new WebpackBundleSizeAnalyzerPlugin('swagger-client.browser-sizes.txt'),
new StatsWriterPlugin({
filename: path.join('swagger-client.browser-stats.json'),
fields: null,
}),
],
optimization: {
minimize: false,
Expand All @@ -74,8 +65,8 @@ const browserMin = {
devtool: 'source-map',
performance: {
hints: 'error',
maxEntrypointSize: 500000,
maxAssetSize: 1300000,
maxEntrypointSize: 350000,
maxAssetSize: 50000000,
},
output: {
path: path.resolve('./dist'),
Expand All @@ -95,8 +86,10 @@ const browserMin = {
module,
plugins: [
new LodashModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
new WebpackBundleSizeAnalyzerPlugin('swagger-client.browser-sizes.txt'),
new StatsWriterPlugin({
filename: path.join('swagger-client.browser-stats.json'),
fields: null,
}),
],
optimization: {
Expand Down
Loading