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'); });