Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixing a path issue in ignores CLI #378

Closed
wants to merge 1 commit into from

3 participants

Justin Reidy James Halliday Glen Huang
Justin Reidy

the --ignores CLI arg doesn't resolve path in the same way as other CLI args.

James Halliday
Owner

One problem here is that a non-top-level module does require('skipme') then users will need to give the full path for skipme which might be behind several layers of node_modules directories.

James Halliday
Owner

Relatedly, I was trying to browserify request which still doesn't work in the latest:

$ browserify -r request > bundle.js
Error: module "dns" not found from "/tmp/xyz/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js"

nor does this work:

$ browserify -i dns -r request > bundle.js
Error: module "dns" not found from "/tmp/xyz/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js"
Glen Huang

Since browser-resolve is able to use this package.json

{
    "browser": {
        "module": false,
        "./path/to/file": false,
    }
}

I guess this option should actually be implemented in browser-resolve, and browserify should merely delegate the option to it.

and I also think browser-resolve should implement an option like map that basic does this:

{
    "browser" : {
        "./path/to/file": "./path/to/another"
    }
}

BTW, you might want to update browser-resolve version to 1.x for both module-deps and browserify. It has fixed a few bugs that allows core modules to be ignored.

Glen Huang curvedmark referenced this pull request in defunctzombie/node-browser-resolve
Closed

ignore and map options? #22

James Halliday
Owner

closing since this has been open for a long time

James Halliday substack closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2013
  1. Justin Reidy
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bin/cmd.js
2  bin/cmd.js
View
@@ -51,7 +51,7 @@ b.on('error', function (err) {
});
[].concat(argv.i).concat(argv.ignore).filter(Boolean)
- .forEach(function (i) { b.ignore(i) })
+ .forEach(function (i) { b.ignore(path.resolve(process.cwd(), i)) })
;
[].concat(argv.r).concat(argv.require).filter(Boolean)
Something went wrong with that request. Please try again.