8000 [Bug]: legal comment not preserved when variable declarations are merged by minifier · Issue #4796 · rolldown/rolldown · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug]: legal comment not preserved when variable declarations are merged by minifier #4796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sapphi-red opened this issue Jun 2, 2025 · 1 comment · Fixed by oxc-project/oxc#11492 or #4845
Assignees

Comments

@sapphi-red
Copy link
Collaborator
sapphi-red commented Jun 2, 2025

Reproduction link or steps

  1. Open https://stackblitz.com/edit/github-8hpzqgef-avn2fhdj?file=rolldown.config.mjs,src%2Fentry.js,dist%2Fentry.js
  2. pnpm i runs automatically
  3. pnpm run build runs automatically

What is expected?

The output to be:

/*! foo */
const e=`foo`,t=`bar`;console.log(e,t);

What is actually happening?

The output is:

const e=`foo`,t=`bar`;console.log(e,t);

System Info

StackBlitz

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @rolldown/browser:  1.0.0-beta.10-commit.bf212da

Any additional comments?

I found this while trying to migrate https://github.com/sapphi-red/web-noise-suppressor to tsdown.

@hyf0
Copy link
Member
hyf0 commented Jun 2, 2025

Notes:

No problem if rolldown doesn't enable minifer.

https://stackblitz.com/edit/github-8hpzqgef-bpvjt4mn?file=rolldown.config.mjs,dist%2Fentry.js

Boshen added a commit to oxc-project/oxc that referenced this issue Jun 5, 2025
…eclarations

fixes rolldown/rolldown#4796

Incorrect span causes comments not being preserved.
graphite-app bot pushed a commit to oxc-project/oxc that referenced this issue Jun 5, 2025
…eclarations (#11492)

fixes rolldown/rolldown#4796

Incorrect span causes comments not being preserved.
github-merge-queue bot pushed a commit that referenced this issue Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
0