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

fix: sourceMaps option is invalid #26216

Closed
wants to merge 2 commits into from

Conversation

XYShaoKang
Copy link

In #24577, the --sourceMaps option was added, but modifying the --sourceMaps option has no effect.

Because --sourceMaps works by adding the environment variable JEST_ENABLE_SOURCE_MAPS, but does not add process.env.JEST_ENABLE_SOURCE_MAPS to the array of strings that createCacheKeyFunction needs to consider when generating cache keys, it caused a cache to be generated when the first test was run, and when the second test was run, modifying process.env.JEST_ENABLE_SOURCE_MAPS would not affect the running result, resulting in the failure of the --sourceMaps.

In facebook#24577, the `--sourceMaps` option was added,
but modifying the `--sourceMaps` option has no effect.

Because `process.env.JEST_ENABLE_SOURCE_MAPS` was not added to
the string array of `createCacheKeyFunction`, it caused a cache
to be generated when the first test was run, and when the second
test was run, modifying `process.env.JEST_ENABLE_SOURCE_MAPS`
would not affect the running result, resulting in the failure of
the `--sourceMaps`.
@react-sizebot
Copy link

react-sizebot commented Feb 22, 2023

Comparing: ca2cf31...9a2591c

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 154.46 kB 154.46 kB = 48.75 kB 48.75 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 156.45 kB 156.45 kB = 49.41 kB 49.42 kB
facebook-www/ReactDOM-prod.classic.js = 530.70 kB 530.70 kB = 94.57 kB 94.57 kB
facebook-www/ReactDOM-prod.modern.js = 514.63 kB 514.63 kB = 92.12 kB 92.12 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 9a2591c

@XYShaoKang XYShaoKang closed this Feb 28, 2023
@XYShaoKang XYShaoKang deleted the fix-sourcemaps-option branch February 28, 2023 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants