-
-
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
Using --no-bundle-external and NODE_PATH #1857
Comments
NODE_PATH is deprecated anyways; I’d suggest using babel to rewrite import paths, or to use a symlink in node_modules. |
Thanks for the suggestions @ljharb. I'm using Typescript which I don't believe does path rewriting for you; it defers that task to the bundler unfortunately. Adding symlinks to node_modules doesn't sound like it would work? I think browserify would definitely ignore those modules in that case. |
You can use babel with typescript now, and only use tsc for typechecking. |
See also #1626 and browserify/resolve#47. |
When did it work? NODE_PATH has been community-deprecated for many, many years; i wasn't aware browserify ever supported it. |
I don't know actually, but the browserify documentation currently states that it does work — and in multiple places at that. See: |
I understand that, but it's important to figure out if the documentation was just always wrong, or if actual support for NODE_PATH was removed intentionally or unintentionally. |
The close in |
Since nobody should ever be using NODE_PATH ever for any reason, I'd prefer it not get fixed, but if it was unintentionally dropped that's a viable argument to fix it. You may want to test various versions of browserify to determine this. |
Hi, I'm trying to create a single bundle for a node app. I want to omit node_modules from the budle, so I use
--no-bundle-external
. And I'm usingNODE_PATH=common
to avoid a lot ofrequire('../../..
Unfortunately it omits everything from
common/
from the bundle. Is there a way to get it to just omitnode_modules
and native node libs (fs, path, etc.) but include my app'scommon
files?The only way I've got it to work so far is to manually list everything to exclude with
-u foo -u bar ...
which is not ideal. Any other options?The text was updated successfully, but these errors were encountered: