Skip to content

fix: generate correct filename for sass files when dts is enabled#802

Merged
ocavue merged 8 commits intomainfrom
ocavue/sass-sp
Mar 6, 2026
Merged

fix: generate correct filename for sass files when dts is enabled#802
ocavue merged 8 commits intomainfrom
ocavue/sass-sp

Conversation

@ocavue
Copy link
Collaborator

@ocavue ocavue commented Mar 6, 2026

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

Description

Linked Issues

Closes #801

Additional context

@netlify
Copy link

netlify bot commented Mar 6, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit d4d8df4
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69aa6568124ccb00082377be
😎 Deploy Preview https://deploy-preview-802--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 6, 2026

Open in StackBlitz

tsdown

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

create-tsdown

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

@tsdown/css

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

@tsdown/exe

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

tsdown-migrate

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

commit: d4d8df4

@ocavue ocavue marked this pull request as ready for review March 6, 2026 05:03
@ocavue ocavue changed the title fix: externalize CSS preprocessors fix: generate correct filename for sass files when dts is enabled Mar 6, 2026
@ocavue ocavue requested a review from Copilot March 6, 2026 05:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CSS/Sass output naming in splitting mode when declaration generation (dts) is enabled (reported in #801), primarily by adding regression coverage and updating related dependencies/config.

Changes:

  • Added new regression tests + snapshots covering css.splitting=true with/without dts, including Sass (.scss) cases.
  • Updated CSS option docs to clarify how fileName is used when splitting=false.
  • Updated workspace dependencies/config to support Sass in tests and to pick up a patched rolldown-plugin-dts.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/css.test.ts Adds regression tests for splitting + dts + Sass scenarios and adjusts the basic fixture naming.
tests/snapshots/css/with-splitting-true.snap.md Snapshot for splitting output (index.css, index.mjs).
tests/snapshots/css/with-dts-true-and-splitting-true.snap.md Snapshot for splitting output when dts=true (index.css, index.d.mts, index.mjs).
tests/snapshots/css/with-sass-and-splitting-true.snap.md Snapshot for Sass + splitting output (index.css, index.mjs).
tests/snapshots/css/with-sass-and-dts-true-and-splitting-true.snap.md Snapshot for Sass + dts=true + splitting output (index.css, index.d.mts, index.mjs).
src/features/css/index.ts Docstring clarification for splitting and fileName.
pnpm-workspace.yaml Adds sass to catalogs and switches rolldown-plugin-dts to a URL-based specifier; updates pnpm trust policy config.
package.json Adds sass to devDependencies via workspace catalog.
packages/css/package.json Adds optional peer deps for sass and sass-embedded.
pnpm-lock.yaml Lockfile updates for Sass deps and the URL-based rolldown-plugin-dts specifier.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

postcss-load-config: ^6.0.1
rolldown: 1.0.0-rc.7
rolldown-plugin-dts: ^0.22.3
rolldown-plugin-dts: https://pkg.pr.new/rolldown-plugin-dts@200
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

The rolldown-plugin-dts catalog entry is switched from a semver range to a pkg.pr.new URL. This is an operational/release risk (non-registry, potentially ephemeral artifact) and makes dependency provenance/versioning harder to track. Consider reverting to a published version (or pinning via a proper release/tag), and if this is only needed for CI verification, keep it as a temporary local override rather than in the prod catalog.

Suggested change
rolldown-plugin-dts: https://pkg.pr.new/rolldown-plugin-dts@200
rolldown-plugin-dts: ^1.0.0-rc.7

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +54
"sass": "*",
"sass-embedded": "*",
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

sass and sass-embedded are added as optional peer dependencies with a "*" range. Using an unbounded peer range can allow incompatible major versions and makes the supported version policy unclear. Consider using a constrained semver range (consistent with the other peers here) based on the versions actually supported/tested.

Suggested change
"sass": "*",
"sass-embedded": "*",
"sass": "^1.0.0",
"sass-embedded": "^1.0.0",

Copilot uses AI. Check for mistakes.
@ocavue ocavue requested a review from sxzz March 6, 2026 05:27
@ocavue ocavue merged commit 848a7b7 into main Mar 6, 2026
15 checks passed
@ocavue ocavue deleted the ocavue/sass-sp branch March 6, 2026 05:36
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.

@tsdown/css not working as expected with splitting mode

3 participants