Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import with query #89

Closed
yepninja opened this issue Jun 5, 2020 · 3 comments
Closed

Import with query #89

yepninja opened this issue Jun 5, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yepninja
Copy link

yepninja commented Jun 5, 2020

Is your feature request related to a problem? Please describe.
Can imoprt css with query:

import styles from './index.css?module'

Describe the solution you'd like
Ignore query in import

Describe alternatives you've considered
customMatcher option is not enough. Typescript can't resolve file with query

@mrmckeb mrmckeb self-assigned this Jun 6, 2020
@mrmckeb mrmckeb added enhancement New feature or request help wanted Extra attention is needed labels Jun 6, 2020
@mrmckeb
Copy link
Owner

mrmckeb commented Jun 6, 2020

Hi @yepninja, this is not something we've tested for - we try to cover the most common methods of working with CSS modules, and this is not an approach I've come across before.

As far as I can tell, TypeScript won't resolve this file as it strictly looks for a that has the extension .css?module. We don't currently modify how TypeScript loads files, only how it processes them.

My best advice at this stage is use a different approach:

  • './index.m.css'
  • './index.module.css'

However, we're always open to a PR if you'd like to take a look at adding support for this yourself :)

@yepninja
Copy link
Author

Unfortunately you are right. Typescript doesn't support module resolver.

It's related to microsoft/TypeScript#18896 and microsoft/TypeScript#38094

@mrmckeb
Copy link
Owner

mrmckeb commented Jun 14, 2020

OK, I'll close this off for now - but feel free to repoen/raise this again if things change :) Sorry you hit this, I wish there was a simple solution.

@mrmckeb mrmckeb closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants