diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js index eba9a19431a..a8144075dd5 100644 --- a/src/bootstrap-amd.js +++ b/src/bootstrap-amd.js @@ -41,12 +41,14 @@ exports.load = function (entrypoint, onLoad, onError) { } // cached data config - loader.config({ - nodeCachedData: { - path: process.env['VSCODE_NODE_CACHED_DATA_DIR'], - seed: entrypoint - } - }); + if (process.env['VSCODE_NODE_CACHED_DATA_DIR']) { + loader.config({ + nodeCachedData: { + path: process.env['VSCODE_NODE_CACHED_DATA_DIR'], + seed: entrypoint + } + }); + } onLoad = onLoad || function () { }; onError = onError || function (err) { console.error(err); }; diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js index e3daa060605..ef3d844e52e 100644 --- a/src/bootstrap-window.js +++ b/src/bootstrap-window.js @@ -91,13 +91,17 @@ exports.load = function (modulePaths, resultCallback, options) { const loaderConfig = { baseUrl: bootstrap.uriFromPath(configuration.appRoot) + '/out', 'vs/nls': nlsConfig, - nodeCachedData: { - path: configuration.nodeCachedDataDir, - seed: modulePaths.join('') - }, nodeModules: [/*BUILD->INSERT_NODE_MODULES*/] }; + // cached data config + if (configuration.nodeCachedDataDir) { + loaderConfig.nodeCachedData = { + path: configuration.nodeCachedDataDir, + seed: modulePaths.join('') + }; + } + if (options && typeof options.beforeLoaderConfig === 'function') { options.beforeLoaderConfig(configuration, loaderConfig); }