-
Notifications
You must be signed in to change notification settings - Fork 44
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
Usage in production and includePaths #69
Comments
I have same questions and still try to figure out the best solution. In addition to |
From my experience so far:
Hope that helps. |
@tmaximini Thanks for answering. There are useful information. |
@tmaximini @wuct sorry guys for the late call. I'll try to answer according to my experience. I don't see any problem to use it in production, since it extends the default
Can you describe the problem a bit more detailed? Talking about second question. Currently, there is no support for Talking about webpack |
thanks @sullenor |
@tmaximini yeah, I got it, thank you. I wonder if I add any adapter to support sass, will it be useful for you? And what kind of configuration would you like to see in it? |
Regarding the flashes, I was able to solve this by following the directions in #53. |
@tmaximini @Jezternz I'm having the same problem with unstyled server side rendered content. I did not understand what was your solution to that problem and the small example provided on this repo uses ExtractTextPlugin on webpack config but I don't want to use this plugin on development. Could you please show me what is your webpack configuration? Are you using webpack for both server and client side code? |
@Jezternz Thanks! with this setup are you able to automatically reload styles when you change a css file? |
@figalex Just checked and I apologise, it does not seem to be doing that. Strangely it registers the change and even sends a notification to client, but the style doesn't update. |
Hey!
I have two questions:
First I have a hard time thinking about if and how to use this hook in production. I am using webpack with css modules for the client side and this require hook on the server side when doing server side rendering of react components. In my production environment I am planning to use ExtractTextPlugin to extract all the css. Currently we are still in development.
What I notice so far is that the require hook is setting the correct classes but it does not include any generated css in the server rendered templates. So I actually get flashes of unstyled content until client side (webpack) picks up, which then inlines the styles into the html. Is this expected behaviour?
Also are there any performance hogs to be expected in production (compiling scss in runtime sounds like it). What is best practice here for setting up this hook for both development and production?
second question:
I have lots of components and lots of scss files. In these files I am importing most of the times other .scss files such as variables and mixins from a shared folder.
Webpack allows a configuration for
modulesDirectories
, similar to this hook'sincludePaths
.The problem is, that with webpack I have to prepend imports from these custom directories with a tilde. e.g.:
@import '~styles/variables';
instead of@import '../../../../styles/variables';
The tilde prefix breaks this require hook, here it would work with just
@import 'styles/variables';
Any idea how to solve this?
Here is my current setup:
The text was updated successfully, but these errors were encountered: