guoyunhe / swc-minify-webpack-plugin

A faster minimizer for webpack based on swc.minify()
Apache License 2.0
7 stars 2 forks source link

Uncorrect source maps after minification #9

Closed Themezv closed 6 months ago

Themezv commented 6 months ago

Source maps after minification should remaps source maps before.

For example.

  1. We have two original files like index.ts and component.tsx
  2. We have some webpack ts loader, for example swc-loader to transpile ts files.
  3. After transpiling we minificate a final bundle.

Actual source maps, produced by minificator, contains information only about already bundled code. Expected behavior: source maps after minification should contains information about index.ts and component.tsx

There are several packages that can remap source maps. For example https://github.com/mozilla/source-map or https://github.com/7rulnik/source-map-js or https://github.com/ampproject/remapping

guoyunhe commented 6 months ago

Should be fixed in 2.1.2. Let me know if it works or not.