rslib icon indicating copy to clipboard operation
rslib copied to clipboard

[Bug]: wrongly export symbol in ESM

Open fi3ework opened this issue 9 months ago • 0 comments

Version

System:
    OS: macOS 15.0.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 145.75 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 134.0.6998.166
    Safari: 18.0.1

Details

the exported myFunc is renamed here https://github.com/web-infra-dev/rspack/blob/bd3e1c202e600995afa2bfab48fcafeb846893cd/crates/rspack_plugin_javascript/src/plugin/mod.rs#L652, which is after the exports definition https://github.com/web-infra-dev/rspack/blob/bd3e1c202e600995afa2bfab48fcafeb846893cd/crates/rspack_core/src/concatenated_module.rs#L1315. And leads to a misalign.

Reproduce link

https://github.com/fi3ework-reproduction/rspack-rename-export-bug

Reproduce Steps

  1. pnpm i
  2. pnpm build
  3. check dist/index.mjs

fi3ework avatar Mar 27 '25 12:03 fi3ework