-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How can I require a file that is built using browserify? #1773
Comments
@saeedseyfi, hmmm would it work for you if you just If you don't want to publish the package to npm you could just put it in a git repo and install using npm git ( |
yeah if possible, requiring the source files directly is ideal. if you must require a browserify bundle, you can first pass it through https://www.npmjs.com/package/derequire to rewrite the |
Thanks for your responses @simonfan @goto-bus-stop :) I'll |
Suggestion: |
browserify/detective#79 will make browserify ignore |
Pending browserify/detective#79 |
Hello browserify lords :)
I built a js library using browserify. Working well in the browser and everything looks great if I put it as a separate file in my html:
But when I want to require the library file in my app, browserify complains.
Because the
require
s are still in the file and if I re-bundle it, browserify wants to re-include the files that are already included.My files:
library/src/foo.js
:library/src/core.js
:app/src/core.js
:library/build.js
is created using browserify:Now I want to build
app/src/core.js
the same way ($ browserify app/src/core.js > app/build.js
) but it complains:Error: Cannot find module './foo' from '/library'
I created a test repo to demo the issue: https://github.com/saeedseyfi/browserify-issue
Please advise.
The text was updated successfully, but these errors were encountered: