Skip to content

fix(css): remove dangling requires and handle CSS extensions in chunk names - #1114

Merged
sxzz merged 2 commits into
mainfrom
fix/css-preserve-modules-name
Nov 2, 2026
Merged

sxzz merged 2 commits into
mainfrom
fix/css-preserve-modules-name

Conversation

@sxzzbot

@sxzzbot sxzzbot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

AI usage

  • No AI was used in this PR.
  • AI was used: Claude Code + Claude Opus 5.5
    • I have carefully reviewed the AI-generated content myself.

Description

With unbundle: true, CJS output kept a require() to a removed pure CSS chunk, so it couldn't be loaded. This removes it, following Vite's getEmptyChunkReplacer.

It also prepares for rolldown/rolldown#11410, which keeps non-JS extensions in [name] (card.css.cjs). Without the toCssFileName change, that Rolldown emits card.css.css. Published tsdown allows it through ~1.2.15, so this should ship before the next Rolldown release.

Linked Issues

Refs #912

The Card2.cjs name goes away with rolldown/rolldown#11410, so #912 can be closed after that upgrade.

Additional context

Alternative to #1077. Tested against both Rolldown 1.2.15 and pkg.pr.new/rolldown@main. Upgrading Rolldown will need updates to the css > unbundle and unbundle > base dir snapshots and the JSON Schema.

@netlify

netlify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 9ab935d
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/6ae82f588ee70136e9f3d86a
😎 Deploy Preview https://deploy-preview-1114--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

tsdown

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

create-tsdown

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

@tsdown/css

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

@tsdown/exe

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

tsdown-migrate

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

commit: 9ab935d

@sxzzbot sxzzbot changed the title fix(css): avoid name clash and dangling requires from pure CSS chunks fix(css): remove dangling requires and handle CSS extensions in chunk names Nov 2, 2026
@sxzzbot
sxzzbot marked this pull request as ready for review November 2, 2026 06:38
@sxzz
sxzz merged commit c8ca303 into main Nov 2, 2026
17 checks passed
@sxzz
sxzz deleted the fix/css-preserve-modules-name branch November 2, 2026 06:39
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