only set nodeCachedData-prop when having a dir, #60332

This commit is contained in:
Johannes Rieken
2018-11-27 15:57:38 +01:00
parent 2319dc2389
commit 2c531e2ede
2 changed files with 16 additions and 10 deletions

View File

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