-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can Browserify be used on server-side Node.js? #1540
Comments
@techpines there's this, which I haven't tried yet but have been meaning to take a look: https://www.npmjs.com/package/noderify |
There is a --node flag which does just this.
|
@techpines: With which solution did you came up? Did noderify work for you? |
Hi @Cyber1000, It's a bit counter intuitive but if you're using the API (which you are, when using Gulp) you should specify So the reason nothing happened is because |
@Cyber1000 I haven't implemented this yet on my end, but I was going to stick with browserify since it's a more mature library and it looks to already has this functionality builtin (plus we're already using it for client-side js) |
Thanks for your answers, in the end I also stick to browserify, I just did an additional "bundleExternal: false" as some third-party-component made problems. So far I got my uglified/browserified server.js up and running. |
browserify process the Node Global __dirname,How can I make it to be ignored by browserify? |
I was facing this problem, too. I was trying to bundle a bunch of server-side JavaScript and I could not do it with the browserify NodeJS API. Guess the browserify library is not really the right tool for the job anyway as the name suggests. Turns out you can use webpack (https://webpack.github.io/) and bundle JavaScript by setting 'node' as the target: http://jlongster.com/Backend-Apps-with-Webpack--Part-I .Works like a charm. |
@goto-bus-stop Is what is said by @keksipurkki true? I would think Browserify supports node as a target considering this exists https://www.npmjs.com/package/serverless-plugin-browserifier |
Can Browserify be used on server-side Node.js?
The Node.js modules system is great, but it leads to some bloat on the filesystem. In most cases, this filesystem bloat isn't really an issue. However, our team has been exploring AWS Lambda, and I'm sure there are similar server-style environments where a smaller code footprint would be helpful. Which is why I thought of Browserify, since it pulls only the dependencies it needs.
Is it possible and if it is, does anyone know if there is any extra configuration needed to make it work properly in a server-style environment?
The text was updated successfully, but these errors were encountered: