enhanced-require
enhanced-require copied to clipboard
If this lib is CURRENTLY UNMAINTAINED, then what I should do to use webpack client side files in node.js?
I have a large app built on webpack and the server side uses that files. How I'm supposed to make them work (in the future) if this project is "CURRENTLY UNMAINTAINED"? I should use another lib or what?
You can compile it with target
"node"
and run the compiled code.
The project is just currently
unmaintained. It planned to get it up to date once I have time to do that.
You can compile it with target "node" and run the compiled code.
Ok, I will try but for dev is not optimal, right? I remember the last time it didn't worked well.
The project is just currently unmaintained. It planned to get it up to date once I have time to do that.
If you need help, and if I will have some time in the future, I might help you.
@sokra Are loaders still supposed to implement sync support as well? I've implemented it for the sass-loader, but it makes the code a lot harder to maintain...
@jhnns I don't have an answer yet. Not sure if enhanced-require
or webpack --target node
is the best way to run on server...
I've tried both and work pretty good.
- With enhanced-require you need more boilerplate code;
- With --target node you put the server code in some other folder which might mess with paths;
I'm using https://github.com/istarkov/babel-plugin-webpack-loaders for my development environment, I'm wondering the same things. I'm only using webpack --target node
for my production environment.
Why don't you use webpack --target node
in development too?
Why don't you use webpack --target node in development too?
To begin with the context, I'm working on the server side with React.
As far as I have played with webpack --target node
, I wasn't satisfied by the time needed to start it. I'm wondering if it's possible to do some hot releading for the server and express, I haven't looked at it.
I endup using babel-plugin-webpack-loaders
.
I also wanted to use babel-plugin-webpack-loaders
for the production environment. But I couldn't. The npm install
on the server requires too much disk space.
Edit: @jhnns Turns out that webpack --target node
with all the production optimization makes the renderToString()
of react 34% faster. So that's definitely the right choice for the production env.
Cool :+1: