Skip to content

Commit ca72aa3

Browse files
committed
Remove explicit gyp.js dependency from package.json
Trying to load gyp.js module only if --gypjs command-line option was supplied.
1 parent f8e0247 commit ca72aa3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/configure.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var fs = require('graceful-fs')
2121
, execFile = cp.execFile
2222
, win = process.platform == 'win32'
2323
, findNodeDirectory = require('./find-node-directory')
24-
, gypjs = require('gyp.js')
24+
, gypjs = undefined
2525

2626
exports.usage = 'Generates ' + (process.env.npm_config_gypjs ? 'ninja build files' : (win ? 'MSVC project files' : 'a Makefile')) + ' for the current module'
2727

@@ -45,6 +45,11 @@ function configure (gyp, argv, callback) {
4545
}
4646
})
4747
} else {
48+
try {
49+
gypjs = require('gyp.js')
50+
} catch (err) {
51+
return callback(new Error('Can\'t find module gyp.js, you can install it with `npm install gyp.js`'))
52+
}
4853
getNodeDir()
4954
}
5055

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"fstream": "^1.0.0",
2626
"glob": "^7.0.3",
2727
"graceful-fs": "^4.1.2",
28-
"gyp.js": "^1.1.1",
2928
"minimatch": "1",
3029
"mkdirp": "^0.5.0",
3130
"nopt": "2 || 3",

0 commit comments

Comments
 (0)