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

Importing css in typescript/webpack project #203

Open
stefaneg opened this issue Sep 10, 2020 · 1 comment
Open

Importing css in typescript/webpack project #203

stefaneg opened this issue Sep 10, 2020 · 1 comment

Comments

@stefaneg
Copy link

The example provided does not work out of the box with my typescript/webpack setup. My guess is that is is because react-dropdown/style.css is resolved to the d.ts file in the package file, so it is never processed by css-loader. My solution is to place an explicit style loader import like this:

import '!style-loader!css-loader!react-dropdown/style.css'

You might want to mention this in the documentation. If there is a better way, then mention that.

@Supriy0498
Copy link

The example provided does not work out of the box with my typescript/webpack setup. My guess is that is is because react-dropdown/style.css is resolved to the d.ts file in the package file, so it is never processed by css-loader. My solution is to place an explicit style loader import like this:

import '!style-loader!css-loader!react-dropdown/style.css'

You might want to mention this in the documentation. If there is a better way, then mention that.

This worked!!!
Thanks!

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

No branches or pull requests

2 participants