Skip to content

fix: add correct type declaration for style.css export#2897

Merged
gpbl merged 1 commit into
gpbl:mainfrom
NotNestor:styleExportFix
Feb 9, 2026
Merged

fix: add correct type declaration for style.css export#2897
gpbl merged 1 commit into
gpbl:mainfrom
NotNestor:styleExportFix

Conversation

@NotNestor

Copy link
Copy Markdown
Contributor

What's Changed

The ./style.css export condition pointed its types at style.module.css.d.ts, which declares a CSS modules object. Plain style.css is not a CSS module — add a dedicated style.css.d.ts and update package.json to reference it.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Additional Notes

The ./style.css export in package.json points its types condition at ./src/style.module.css.d.ts, which types the default export as a CSS module object. This is incorrect for plain ./style.css — bundlers return a CSS string, not an object. This causes a type error with moduleResolution: "bundler" since the exports map takes precedence over ambient declare module overrides.

This PR adds a src/style.css.d.ts that correctly types the export as string, and updates the exports map to reference it.

The ./style.css export condition pointed its types at style.module.css.d.ts, which declares a CSS modules object. Plain style.css is not a CSS module — add a dedicated style.css.d.ts and update package.json to reference it.
@NotNestor NotNestor requested a review from gpbl as a code owner February 9, 2026 15:55
@gpbl

gpbl commented Feb 9, 2026

Copy link
Copy Markdown
Owner

Good find @NotNestor - thanks for your contribution.

@gpbl gpbl merged commit 12cf80b into gpbl:main Feb 9, 2026
11 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.

3 participants