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

Webpack2 import #12

Open
balajmarius opened this issue Jun 19, 2017 · 3 comments
Open

Webpack2 import #12

balajmarius opened this issue Jun 19, 2017 · 3 comments

Comments

@balajmarius
Copy link

balajmarius commented Jun 19, 2017

I'm trying to use Sip.css with webpack 2 / react-create-app but the result of the import is a string.

import Sip from 'sip.css'

console.log(Sip) -> /static/media/sip.5c5e6212.mjs
console.log(typeof Sip) -> string

I am doing something wrong?

@lukehedger
Copy link
Owner

@balajmarius interesting - looks like it thinks 'sip.css' references a CSS file! Must be something to do with CRA webpack config, as works with a simple config.

@balajmarius
Copy link
Author

balajmarius commented Jul 22, 2017

You are right, CRA uses css-loader and sip.css is interpreted as a CSS file.

@lukehedger
Copy link
Owner

@balajmarius I guess if Sip is being used then so will a CSS-in-JS library, which means css-loader will not be needed? CRA users could then just run npm run eject and remove from Webpack config.

It is interesting that CSS-in-JS isn't the default for CRA but I imagine they wanted to keep it as simple as possible!

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