Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

If this lib is CURRENTLY UNMAINTAINED, then what I should do to use webpack client side files in node.js? #15

Open
totty90 opened this issue Feb 23, 2015 · 9 comments

Comments

@totty90
Copy link

totty90 commented Feb 23, 2015

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?

@sokra
Copy link
Member

sokra commented Feb 23, 2015

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.

@totty90
Copy link
Author

totty90 commented Feb 23, 2015

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.

@jhnns
Copy link
Member

jhnns commented Mar 17, 2015

@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...

@sokra
Copy link
Member

sokra commented Mar 20, 2015

@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...

@totty90
Copy link
Author

totty90 commented Mar 20, 2015

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;

@oliviertassinari
Copy link

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.

@jhnns
Copy link
Member

jhnns commented Jan 18, 2016

Why don't you use webpack --target node in development too?

@oliviertassinari
Copy link

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.

@jhnns
Copy link
Member

jhnns commented Jan 19, 2016

Cool 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants