From c1ef29da9bad10f47f75ec9db32f72721d7d73fd Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 12 Feb 2016 12:04:03 +0100 Subject: [PATCH] export bootstrap from bootstrap-amd --- src/bootstrap-amd.js | 12 +++++++++--- src/main.js | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js index ff1d08e7d67..c53d8d1ebc2 100644 --- a/src/bootstrap-amd.js +++ b/src/bootstrap-amd.js @@ -33,7 +33,13 @@ if (nlsConfig.pseudo) { }); } -var entrypoint = process.env['AMD_ENTRYPOINT']; -if (entrypoint) { +var bootstrap = exports.bootstrap = function (entrypoint) { loader([entrypoint], function () { }, function (err) { console.error(err); }); -} +}; + +if (require.main === module) { + var entrypoint = process.env['AMD_ENTRYPOINT']; + if (entrypoint) { + bootstrap(entrypoint); + } +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index c4cc3ae1f00..09a6f986ffc 100644 --- a/src/main.js +++ b/src/main.js @@ -76,6 +76,5 @@ process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); // Load our code once ready app.once('ready', function() { - process.env['AMD_ENTRYPOINT'] = 'vs/workbench/electron-main/main'; - require('./bootstrap-amd'); + require('./bootstrap-amd').bootstrap('vs/workbench/electron-main/main'); });