From f999b64a46e9196d45793a238ab729d90b5d3b21 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 28 Jun 2016 12:11:00 +0200 Subject: [PATCH] also check npm < 3.0 node modules location --- gulpfile.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index dae01120..e56bd310 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -31,7 +31,19 @@ gulp.task('release', ['clean-release','compile'], function() { '' ].join('\n'); + var jsoncLocation = __dirname + '/node_modules/jsonc-parser/lib'; + if (!fs.existsSync(jsoncLocation)) { + var oldJsconcLocation = __dirname + '/node_modules/vscode-json-languageservice/node_modules/jsonc-parser/lib'; + if (!fs.existsSync(oldJsconcLocation)) { + console.error('Unable to find jsonc node module at ' + jsoncLocation + ' or ' + oldJsconcLocation); + return; + } + jsoncLocation = oldJsconcLocation; + } + function bundleOne(moduleId, exclude) { + + return rjs({ baseUrl: '/out/', name: 'vs/language/json/' + moduleId, @@ -50,7 +62,7 @@ gulp.task('release', ['clean-release','compile'], function() { main: 'main' }, { name: 'jsonc-parser', - location: __dirname + '/node_modules/jsonc-parser/lib', + location: jsoncLocation, main: 'main' }, { name: 'vscode-nls',