babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

[1046] Maintain source mapping for merged sibling vars. #1047

Open seanmorris opened 1 year ago

seanmorris commented 1 year ago

The plugin babel-plugin-transform-merge-sibling-variables does not maintain source mapping when merging sibling variable declarators into a single declaration after babel-plugin-transform-modules-commonjs has been applied.

To Reproduce: Minify a file that has been processed with babel-plugin-transform-modules-commonjs. If the original file has more than one import statement, the mapping will be lost.

Minimal code to reproduce the bug: https://github.com/babel/minify/issues/1046