opened
peter-mouland
username_0
I've been using this plugin on the server to help render universal apps.  The app requires in some code that imports scss, which on the server, is duly ignored.  This works find when i was running the server and the first step was to call `babel-core/register`.

Not that I am trying to remove babel from my prod code i find that the hook is no longer working.  By removing babel from my prod code I mean instead i use babel-cli to precompile the server.  I then get node to run the compiled code.

I noticed you mentioned cache in your readme, but i don't beleive it is that as the error suggests the hook isn't doing anything : 

```
Error: Cannot find module './mainLayout.scss'
```

It seems to me babel register and babel-cli compile in different ways, which doesn't sound right?

have you any idea?

To help, here is a quick place to see that code changes I've made to my app : 
https://github.com/username_0/react-lego/compare/remove-prod-babel

the whole app (with this new branch) is available here: 
https://github.com/username_0/react-lego/tree/remove-prod-babel
not working when server code is precompiled
issue
created
bahmutov
username_1
Hmm, not sure what is going on here, but seems loading and transforming CSS files might require Babel. Node hook only calls the user supplied function when loading the file, and does not know how to transform to / from .css files. You can easily debug the node-hook yourself by adding console statements to it source code, and print what it is trying to load and the file paths.
comment
created
peter-mouland
username_0
if I remember to take a deeper look, i'll let you know the results.  

In the meantime however I have a way to get the code to work by compiling the server using webpack (with babel-loader + ExtractTextPlugin for the scss).  I think i'd prefer to use babel-cli directly  in the long run as this makes less changes to the code.
comment
created
peter-mouland
username_0
closing this as it's no longer a problem. not sure what i did to solve it!
comment
closed
peter-mouland
username_0
issue