Skip to content

[Bug]: wrongly export symbol in ESM #881

Open
@fi3ework

Description

@fi3ework

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    RspackRspack related issue

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions