File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,11 @@ module.exports = function (x, options) {
67
67
}
68
68
69
69
function loadpkg ( dir ) {
70
- if ( dir === '' || dir === '/' || ( / [ / \\ ] n o d e _ m o d u l e s [ / \\ ] * $ / ) . test ( dir ) ) {
71
- return null ;
70
+ if ( dir === '' || dir === '/' ) return ;
71
+ if ( process . platform === 'win32' && ( / ^ \w : [ / \\ ] * $ / ) . test ( dir ) ) {
72
+ return ;
72
73
}
74
+ if ( / [ / \\ ] n o d e _ m o d u l e s [ / \\ ] * $ / . test ( dir ) ) return ;
73
75
74
76
var pkgfile = path . join ( dir , 'package.json' ) ;
75
77
Original file line number Diff line number Diff line change @@ -115,6 +115,12 @@ options are:
115
115
116
116
* ` opts.packageFilter(pkg, pkgfile) ` - transform the parsed package.json contents before looking at the "main" field
117
117
118
+ * ` opts.pathFilter(pkg, path, relativePath) ` - transform a path within a package
119
+ * pkg - package data
120
+ * path - the path being resolved
121
+ * relativePath - the path relative from the package.json location
122
+ * returns - a relative path that will be joined from the package.json location
123
+
118
124
* opts.paths - require.paths array to use if nothing is found on the normal ` node_modules ` recursive walk (probably don't use this)
119
125
120
126
* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: ` "node_modules" `
You can’t perform that action at this time.
0 commit comments