-
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
require doesn't work when path is a variable #664
Comments
browserify doesn't work with conditional requires and can't be made to work with arbitrary dynamic requires without solving the halting problem first. Do something different instead. This is a dead end. |
😳 a response from the master! Thank you for such a pragmatic response. I'll do a little more research and see what other things I can do to solve the problem. |
@naomik have a look at the browser-field to load different modules in the browser than in node. If you need more power, i.e. swap out modules for different environments browserify-swap may help you, but you gotta have a real good reason to do that (kinda hacky). |
Usually dynamic dependencies are not necessary 😄 |
I am trying to do something like this
Some file that uses the config
And bundle with this command
Browserify is not picking up the
NODE_ENV
assignment and it's trying to includefail
environment when I run my testing bundle 😦The text was updated successfully, but these errors were encountered: