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

metro-minify-terser: Don't mutate input options #929

Closed
wants to merge 1 commit into from

Commits on Feb 17, 2023

  1. metro-minify-terser: Don't mutate input options

    Summary:
    Mitigates terser/terser#1341
    
    Terser sets properties inlcuding `source_map` and `_destroy_ast` on the given `options.output` (or `options.format`) object, which can affect subsequent calls where we re-use the same config object.
    
    Here we take a shallow copy of the given configuration, so `terser` doesn't mutate `metro-minify-terser`'s input.
    
    Changelog: [Fix] Mitigate potential source map mismatches with concurrent transformations (Terser [#1341](terser/terser#1341))
    
    Reviewed By: jacdebug, motiz88
    
    Differential Revision: D43362977
    
    fbshipit-source-id: 019f417aa8cc7897c71a6ab2c7db5d0cf916e59d
    robhogan authored and facebook-github-bot committed Feb 17, 2023
    Copy the full SHA
    851e64f View commit details
    Browse the repository at this point in the history