-
Notifications
You must be signed in to change notification settings - Fork 532
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
Fix bundle size test after webpack 5 update #10502
Conversation
⯅ @fluid-example/bundle-size-tests: +1.16 MB
Baseline commit: c32854f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it practical to make this test fail if it's clearly not working in this way? Maybe check the bundle is valid/works, or check for a minimum size? |
@CraigMacomber yeah, I was thinking about telemetry and alert would be good, but your suggestion to just failed the test is great if the size is under certain limit. Let me make a follow up PR. |
Follow up to PR #10502, where we broke the bundle size test. This change updates the tools to include some sanity check by processing the generated stats file and error if the asset size being tested is smaller than certain threshold (currently set at 100 bytes). Note that the build tool package will need to be published and updated in the core packages mono repo before this will take effect. Example output of the tool if the fix for #10502 is removed: ``` found bundleAnalysis for @fluid-example/bundle-size-tests @fluid-example/bundle-size-tests: asset aqueduct.js (23) is too small @fluid-example/bundle-size-tests: asset connectionState.js (23) is too small @fluid-example/bundle-size-tests: asset containerRuntime.js (23) is too small @fluid-example/bundle-size-tests: asset loader.js (23) is too small @fluid-example/bundle-size-tests: asset map.js (23) is too small @fluid-example/bundle-size-tests: asset matrix.js (23) is too small @fluid-example/bundle-size-tests: asset odspDriver.js (23) is too small @fluid-example/bundle-size-tests: asset odspPrefetchSnapshot.js (23) is too small @fluid-example/bundle-size-tests: asset sharedString.js (23) is too small Error: Found assets are too small (<100 bytes). Webpack bundle analysis is probably not correct. ```
PR #10186 upgraded to webpack 5, which caused the output of the bundle-size-test to be all 23 bytes with all export removed.
See #10186 (comment)
Adding
output.library
in the webpack config fixes the issue.