-
Notifications
You must be signed in to change notification settings - Fork 293
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
Style Loader #188
Comments
Actually, the above code was only working in storybook, but it seems to be a far more complicated task to properly import css and scss into the isomorphic framework. CSS import seems to be a bleeding edge issue and I haven't found a successful configuration for this framework yet. Has anybody else had luck? |
I installed the following dependencies, and then added them to webpack.config.js -
And in the component files, i use ES5 requires, to import the scss file. |
FYI this is exclusively an issue with the server aspect of getting the stylesheet. I sort of ran into this problem as well, and was able to get it working by doing the following: if (typeof window === 'object') {
require('./styles.css')
} But as you probably know, that means server-side rendering wont happen. My pages had a brief period where no styles were displayed, and then they showed up after initial load. Back to the drawing board! |
@ajhool Do you mean adding Also, I'm not too certain if this will have an impact, but it looks like the react-router v4 pull is going to be merged soon, so the way you hook this up to server rendering may change as well. |
I am attempting to load the CSS for the https://github.com/davidchin/react-input-range component. I have followed @mininternet’s suggestion to install dependencies and add to the webpack, but I am unsure whether this belongs in the babel set, the assets set, or …? Either way, I get this message:
Any advice would be greatly appreciated. |
This sounds to me like an issue with that particular package, rather than the webpack loaders. |
I can't rule that out, but I also still don't know whether these webpack rules go in Babel, Assets, something else, and I have had no luck with other components to boot. |
@EricWVGG - they go in webpackconfig.js. I've updated my comment above to reflect that. But this is really more a webpack configuration issue rather than anything to do specifically with ARc. |
"I have followed @mininternet’s suggestion to install dependencies and add to the webpack, but I am unsure whether this belongs in the babel set, the assets set"
|
Successfully able to add like this,
in
hope this help others, thx and keep up the good work |
@sasajib but it's will not work with isomorphic app |
Any interest in adding a css style loader to webpack by default? I believe the dependency is:
npm install --save-dev css-loader
With the most basic rule added to webpack.config.js :
The text was updated successfully, but these errors were encountered: