Skip to content

Commit 2c531e2

Browse files
committed
only set nodeCachedData-prop when having a dir, microsoft#60332
1 parent 2319dc2 commit 2c531e2

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/bootstrap-amd.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ exports.load = function (entrypoint, onLoad, onError) {
4141
}
4242

4343
// cached data config
44-
loader.config({
45-
nodeCachedData: {
46-
path: process.env['VSCODE_NODE_CACHED_DATA_DIR'],
47-
seed: entrypoint
48-
}
49-
});
44+
if (process.env['VSCODE_NODE_CACHED_DATA_DIR']) {
45+
loader.config({
46+
nodeCachedData: {
47+
path: process.env['VSCODE_NODE_CACHED_DATA_DIR'],
48+
seed: entrypoint
49+
}
50+
});
51+
}
5052

5153
onLoad = onLoad || function () { };
5254
onError = onError || function (err) { console.error(err); };

src/bootstrap-window.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,17 @@ exports.load = function (modulePaths, resultCallback, options) {
9191
const loaderConfig = {
9292
baseUrl: bootstrap.uriFromPath(configuration.appRoot) + '/out',
9393
'vs/nls': nlsConfig,
94-
nodeCachedData: {
95-
path: configuration.nodeCachedDataDir,
96-
seed: modulePaths.join('')
97-
},
9894
nodeModules: [/*BUILD->INSERT_NODE_MODULES*/]
9995
};
10096

97+
// cached data config
98+
if (configuration.nodeCachedDataDir) {
99+
loaderConfig.nodeCachedData = {
100+
path: configuration.nodeCachedDataDir,
101+
seed: modulePaths.join('')
102+
};
103+
}
104+
101105
if (options && typeof options.beforeLoaderConfig === 'function') {
102106
options.beforeLoaderConfig(configuration, loaderConfig);
103107
}

0 commit comments

Comments
 (0)