basedir not resolving in dependencies
See original GitHub issueCorrect 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:
js/app.js
js/src/models/Person.js
js/src/views/PersonView.js
(Note: app.js
requires PersonView.js
)
I would expect to be able to require Person.js
from within PersonView.js
like so:
var Person = require('./src/models/Person');
Instead of the normal method, relatively to process.cwd()
:
var Person = require('../models/Person');
But running bundle
…
var b = browserify('./app', {basedir: './js'});
b.bundle().pipe(process.stdout);
… I get the following error:
Error: module "./src/models/Person" not found from "/Users/..some path.../js/src/views/PersonView.js"
Any hint/help would be much appreciated.
Issue Analytics
- State:
- Created 10 years ago
- Comments:5
Top Results From Across the Web
Hudson Maven ${basedir} can't find dependency
I have a created a maven repo in a directory called lib in the base of my project. I can use maven to...
Read more >Maven ${project.parent.basedir} : IDEA-106594 - YouTrack
The ${project. parent. basedir} variable does not resolve in IntelliJ - it is highlighted as an error with the message "Cannot resolve symbol:...
Read more >Could not resolve dependencies error-Apache Mail Archives
Hi, We have an issue with Maven not finding a certain dependency, anyone able to help this Maven. Keep in mind that I'm...
Read more >Workspace setup throwing errors in spite of adding RAML ...
Workspace setup throwing errors in spite of adding RAML dependencies in the pom file. Added this dependency in POM file but still getting...
Read more >Automatic Property Expansion with Spring Boot - Baeldung
This will resolve all the project's properties. We still cannot define properties with dots (e.g. user.name) in the build.gradle, but now we can ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bstst You made my day! @substack How come this is not documented? Can we rely on it?
The
paths
option is documented inbrowser-resolve
. That makes sense.