Switch to GenMapping for sourcemap generation #1190
[`gen-mapping`](https://github.com/jridgewell/gen-mapping) is faster, smaller, and lighter sourcemap generation library. This also exposes a new `decodedMap` property on the result object. Decoded maps are free to create (it's a shallow clone of the `GenMapping` instance), and passing them to `@jridgewell/trace-mapping` is copy-free. With Babel [recently](babel/babel#14497) adding a `decodedMap` field, a dev could pass from the Babel transpilation to Terser without any added memory use for sourcemaps. And if there's a multi stage build process, a dev could use `@ampproject/remapping` to remap Babel, Terser, and (eg) a bundler's outputs without having to feed input maps into each stage.
I'm thinking both this PR and your previous #1180 are breaking changes, as they change how Terser can be loaded in the browser without a package manager (see https://github.com/terser/terser#api-reference).
So the next release will be Terser 6.0.0, and I'll likely take away this browser-loading capability.
I've noticed a small uptick in memory usage, but better speed.
I'm comparing with this branch merged to
This isn't concerning at all, just wanted to point it out.
This is a little surprising. I added memory usage benchmarks which are favorable. I can massage the
Hopefully. I reused the same