Fixes Microsoft/monaco-editor#204: Do what monaco-html does to resolve vscode-uri

This commit is contained in:
Alex Dima 2016-09-26 22:35:04 +03:00
parent 737e0f1650
commit 59d79a9a2b
2 changed files with 22 additions and 1 deletions

View file

@ -41,6 +41,22 @@ gulp.task('release', ['clean-release','compile'], function() {
jsoncLocation = oldJsconcLocation;
}
function getDependencyLocation(name, libLocation, container) {
var location = __dirname + '/node_modules/' + name + '/' + libLocation;
if (!fs.existsSync(location)) {
var oldLocation = __dirname + '/node_modules/' + container + '/node_modules/' + name + '/' + libLocation;
if (!fs.existsSync(oldLocation)) {
console.error('Unable to find ' + name + ' node module at ' + location + ' or ' + oldLocation);
return;
}
return oldLocation;
}
return location;
}
var uriLocation = getDependencyLocation('vscode-uri', 'lib', 'vscode-html-languageservice');
function bundleOne(moduleId, exclude) {
@ -64,6 +80,10 @@ gulp.task('release', ['clean-release','compile'], function() {
name: 'jsonc-parser',
location: jsoncLocation,
main: 'main'
}, {
name: 'vscode-uri',
location: uriLocation,
main: 'index'
}, {
name: 'vscode-nls',
location: __dirname + '/out/fillers',