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

[INTERNAL] Minifier: Fix handling of input source maps of bundles #944

Merged
merged 2 commits into from Oct 10, 2023

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Oct 10, 2023

Apparently there are known cases where projects execute a UI5 Tooling build on a previous build result. In this case we will minify previously created (and already minified) preload bundles.

The source maps associated with these bundles are index- (or "sectioned") source maps. Some section maps (for example those generated during the bundling) might be lacking the "names" array. Since this is fine for regular source map, I assume this should be fine for index source maps too.

Apparently, Terser fails to parse these source maps as of today. Therefore we will manually add the missing "names" array for the time being.

I proposed an upstream fix here:
jridgewell/trace-mapping#29

Apparently there are known cases where projects execute a UI5 Tooling
build on a previous build result. In this case we will minify previously
created (and already minified) preload bundles.

The source maps associated with these bundles are index- (or "sectioned")
source maps. Some section maps (for example those generated during the
bundling) might be lacking the "names" array. Since this is fine for
regular source map, I assume this should be fine for index source maps
too. Apparently, Terser fails to parse these source maps as of today.
Therefore we will manually add the missing "names" array for the time
being.
@RandomByte RandomByte requested a review from a team October 10, 2023 13:17
@coveralls
Copy link

coveralls commented Oct 10, 2023

Coverage Status

coverage: 94.459% (+0.009%) from 94.45% when pulling 625b3fd on minifier-ignore-input-index-source-maps into 52bf258 on main.

Declare source maps as JSON instead of strings
@RandomByte RandomByte merged commit f1c57ac into main Oct 10, 2023
17 checks passed
@RandomByte RandomByte deleted the minifier-ignore-input-index-source-maps branch October 10, 2023 14:01
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.

None yet

3 participants