-
-
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
basedir not resolving in dependencies #700
Comments
Try using a for-some-reason-undocumented 'paths' option (an array of strings) instead, it works for me perfectly: var b = browserify('./app', {paths: ['./js']}); |
@bstst You made my day! @substack How come this is not documented? Can we rely on it? |
Be careful, it looks like it is messing up things when used in conjunction with TLDR Problem 1: Given this
And the following file structure:
In Strangely enough, if you Problem 2: "deep" Considering the same file structure as above, but with the following
And also shimming
When trying to run the
Conclusion |
It works for me because I'm not using browserify-shim, which I never liked ideologically -- I prefer to rely on separately bundled globally available lib assets to avoid doing _ = require('underscore') and Backbone = require('backbone') etc in every module of my code. Ignoring that -- I am looking into fixing browserify's path issues, as there are quite a lot of them in the code. |
The |
Correct me if I'm wrong, but setting
basedir
, I expect to be able to require relatively to this folder, inside the dependencies.I have a very simple example that I cannot make work, given the following file structure:
(Note:
app.js
requiresPersonView.js
)I would expect to be able to require
Person.js
from withinPersonView.js
like so:Instead of the normal method, relatively to
process.cwd()
:But running
bundle
...... I get the following error:
Any hint/help would be much appreciated.
The text was updated successfully, but these errors were encountered: