Skip to content

Firestore: fix rollup config to keep intermediate bundles for source maps #7379

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

Closed
wants to merge 2 commits into from

Conversation

dconeybe
Copy link
Contributor

Firestore's rollup configuration produces some "intermediate" bundles, which are then further processed into the ultimate bundles. However, these "intermediate" bundles happen to have the same name as some of the "ultimate" bundles and get clobbered. As a result, the source maps refer to the bundled file rather than to the original sources, rendering the source maps useless.

Although I wasn't able to figure out how to get the source maps of the "ultimate" bundles to point to the original sources, I figured out how to at least save the "intermediate" bundles. This allows a 2-step process to look up the original source code by first looking up the map from the "ultimate" file to the "intermediate" file, then from the "intermediate" file to the original source code.

… so that source maps of the ultimate bundles work correctly.
@dconeybe dconeybe self-assigned this Jun 21, 2023
@dconeybe dconeybe requested review from a team as code owners June 21, 2023 20:30
@changeset-bot
Copy link

changeset-bot bot commented Jun 21, 2023

⚠️ No Changeset found

Latest commit: 7189c91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 21, 2023

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 21, 2023

@dconeybe
Copy link
Contributor Author

@hsubox76 @DellaBitta @milaGGL FYI this is the change I'm proposing to make to Firestore's rollup bundling to fix the broken source maps for esm2017 bundles. Let me know what you think. It will increase the npm download size by about 1.4 MB (an increase of about 25%).

@dconeybe
Copy link
Contributor Author

Closing this PR as it is superseded by #7382

@dconeybe dconeybe closed this Jun 22, 2023
@dconeybe dconeybe deleted the dconeybe/SourceMapRollupFix branch June 22, 2023 03:42
@firebase firebase locked and limited conversation to collaborators Jul 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants