Skip to content

fix(css): use aliased exports for CSS module keys#840

Merged
sxzz merged 6 commits intorolldown:mainfrom
wChenonly:fix-css-export
Mar 25, 2026
Merged

fix(css): use aliased exports for CSS module keys#840
sxzz merged 6 commits intorolldown:mainfrom
wChenonly:fix-css-export

Conversation

@wChenonly
Copy link
Contributor

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.

Description

fix the issue where reserved words cannot be exported correctly in CSS modules

add a check for JavaScript reserved words to avoid using reserved words as named exports when exporting CSS modules

reserved words referenced

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#reserved_words

Linked Issues

#839

Additional context

…ectly in CSS modules

add a check for JavaScript reserved words to avoid using reserved words as named exports when exporting CSS modules
@netlify
Copy link

netlify bot commented Mar 18, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 63e2784
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69c34cab64d6fb0008b9e4b3
😎 Deploy Preview https://deploy-preview-840--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 18, 2026

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@840 -D
npm i https://pkg.pr.new/tsdown@840 -D
yarn add https://pkg.pr.new/tsdown@840.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@840 -D
npm i https://pkg.pr.new/create-tsdown@840 -D
yarn add https://pkg.pr.new/create-tsdown@840.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@840 -D
npm i https://pkg.pr.new/@tsdown/css@840 -D
yarn add https://pkg.pr.new/@tsdown/css@840.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@840 -D
npm i https://pkg.pr.new/@tsdown/exe@840 -D
yarn add https://pkg.pr.new/@tsdown/exe@840.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@840 -D
npm i https://pkg.pr.new/tsdown-migrate@840 -D
yarn add https://pkg.pr.new/tsdown-migrate@840.tgz -D

commit: 63e2784

Comment on lines +1667 to +1668
const js = await readFile(`${outputDir}/index.mjs`, 'utf8')
const css = await readFile(`${outputDir}/style.css`, 'utf8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clearly AI vibe-coded. Please be honest and check the checkbox on the PR template accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very sure that I did not use it, the only PR I used has been marked

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't refer to the original CSS for testing. test.ts, I also have tests in my own project, and I've done similar unified test entry points, something like this form, so I just migrated it directly.

@sxzz sxzz changed the title fix (css): fix the issue where reserved words cannot be exported correctly in CSS modules fix(css): use aliased exports for CSS module keys Mar 25, 2026
@sxzz sxzz merged commit bb6decb into rolldown:main Mar 25, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants