-
Notifications
You must be signed in to change notification settings - Fork 360
Closed
Labels
CSShas-fixA fix is available, but may not yet be released.A fix is available, but may not yet be released.
Description
when trying to import a CSS module in a typescript file, Typescript will give an error that it can't find the CSS module, whereas a JS module importing a CSS module works just fine. Here's a minimal reproducible example: https://gist.github.com/NickBeeuwsaert/e091e6dd45dc7c639fff91a87ee5fd7e
If you include a css-modules.d.ts file in your tsconfig.json like below, the error will go away:
/// css-modules.d.ts
declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}
/// tsconfig.json
{
"include": ["./css-modules.d.ts"]
}
This had me confused for around an hour, it would be nice if this was documented or worked out of the box. I'd be happy to work on a PR for documentation or getting this to work out of the box.
developit
Metadata
Metadata
Assignees
Labels
CSShas-fixA fix is available, but may not yet be released.A fix is available, but may not yet be released.