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

Set output.chunkFormat to commonjs by default #2136

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jan 24, 2024

By default, Webpack will use JsonpChunkLoadingRuntimeModule to load chunks. This injects document into the Snap code, causing it to break. By setting output.chunkFormat to commonjs, we can disable JsonpChunkLoadingRuntimeModule.

More context here: #2135

@Mrtenz Mrtenz requested a review from a team as a code owner January 24, 2024 19:18
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (53eb3c3) 96.54% compared to head (0367961) 96.54%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2136   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         331      331           
  Lines        7459     7459           
  Branches     1145     1145           
=======================================
  Hits         7201     7201           
  Misses        258      258           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

*
* @see https://webpack.js.org/configuration/output/#outputchunkformat
*/
chunkFormat: 'commonjs',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious how this is needed when we don't do chunks 🤔

Does Webpack see our bundle as 1 chunk then and still applies whatever chunking rules?

@FrederikBolding
Copy link
Member

Maarten has asked that we don't merge this yet until he looks into why it happens.

@Mrtenz Mrtenz force-pushed the mrtenz/chunk-format-commonjs branch from fe8d580 to 0367961 Compare February 6, 2024 13:23
@Mrtenz Mrtenz merged commit 5d5b00c into main Feb 6, 2024
147 checks passed
@Mrtenz Mrtenz deleted the mrtenz/chunk-format-commonjs branch February 6, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants