Skip to content

Commit

Permalink
Remove explicit gyp.js dependency from package.json
Browse files Browse the repository at this point in the history
Trying to load gyp.js module only if --gypjs command-line option was supplied.
  • Loading branch information
pmed committed Jun 20, 2016
1 parent 75673e0 commit 59d7c4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var fs = require('graceful-fs')
, execFile = cp.execFile
, win = process.platform == 'win32'
, findNodeDirectory = require('./find-node-directory')
, gypjs = require('gyp.js')
, gypjs = undefined

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

Expand All @@ -45,6 +45,11 @@ function configure (gyp, argv, callback) {
}
})
} else {
try {
gypjs = require('gyp.js')
} catch (err) {
return callback(new Error('Can\'t find module gyp.js, you can install it with `npm install gyp.js`'))
}
getNodeDir()
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"fstream": "^1.0.0",
"glob": "^7.0.3",
"graceful-fs": "^4.1.2",
"gyp.js": "^1.1.1",
"minimatch": "1",
"mkdirp": "^0.5.0",
"nopt": "2 || 3",
Expand Down

0 comments on commit 59d7c4f

Please sign in to comment.