Skip to content

Fix: css @import - #299

Closed
lachlanmcmillan wants to merge 2 commits into
mrmckeb:mainfrom
lachlanmcmillan:fix/css-import
Closed

lachlanmcmillan wants to merge 2 commits into
mrmckeb:mainfrom
lachlanmcmillan:fix/css-import

Conversation

@lachlanmcmillan

Copy link
Copy Markdown

Issue

fixes #275

When one CSS module @imports another (e.g. fileB.module.css imports fileA.module.css), Vite / css-loader exposes classes from both files on the importing module. This plugin does not, so the Typescript lanaguage service shows an error that the classes referenced from fileA.module.css do not exist.

Fix

Updated the PostCSS import pipeline

Test plan

  • New test: fileB.module.css @imports fileA.module.css; expects both class1 and class2 with the default processor
  • Existing suite passes (pnpm test / npm test)

@mrmckeb

mrmckeb commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

I was going to merge this, but I realised that it could be a breaking change for some users.

Today, we do support this, but you need to define your own postcss settings (via a postcss config file).

We're reworking this plugin for TypeScript 7, so I'll be sure to add support for this there. Thanks!

@mrmckeb mrmckeb closed this Oct 24, 2026
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.

@import is not being supported

2 participants