Adopt loader's amdModulesPattern option

This commit is contained in:
Alex Dima 2020-07-07 23:30:27 +02:00
parent bf2299cda1
commit bb95f3aa40
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
4 changed files with 6 additions and 17 deletions

View file

@ -37,11 +37,6 @@ const { compileBuildTask } = require('./gulpfile.compile');
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
const nodeModules = ['electron', 'original-fs']
.concat(Object.keys(product.dependencies || {}))
.concat(_.uniq(productionDependencies.map(d => d.name)))
.concat(baseModules);
// Build
const vscodeEntryPoints = _.flatten([
@ -94,7 +89,7 @@ const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
src: 'out-build',
entryPoints: vscodeEntryPoints,
resources: vscodeResources,
loaderConfig: common.loaderConfig(nodeModules),
loaderConfig: common.loaderConfig(),
out: 'out-vscode',
bundleInfo: undefined
})
@ -105,12 +100,6 @@ const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${
const minifyVSCodeTask = task.define('minify-vscode', task.series(
optimizeVSCodeTask,
util.rimraf('out-vscode-min'),
() => {
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
const contents = fs.readFileSync(fullpath).toString();
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
fs.writeFileSync(fullpath, newContents);
},
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
));
gulp.task(minifyVSCodeTask);

View file

@ -28,13 +28,13 @@ const REPO_ROOT_PATH = path.join(__dirname, '../..');
function log(prefix, message) {
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
}
function loaderConfig(emptyPaths) {
function loaderConfig() {
const result = {
paths: {
'vs': 'out-build/vs',
'vscode': 'empty:'
},
nodeModules: emptyPaths || []
amdModulesPattern: /^vs\//
};
result['vs/css'] = { inlineResources: true };
return result;

View file

@ -32,13 +32,13 @@ function log(prefix: string, message: string): void {
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
}
export function loaderConfig(emptyPaths?: string[]) {
export function loaderConfig() {
const result: any = {
paths: {
'vs': 'out-build/vs',
'vscode': 'empty:'
},
nodeModules: emptyPaths || []
amdModulesPattern: /^vs\//
};
result['vs/css'] = { inlineResources: true };

View file

@ -87,7 +87,7 @@
const loaderConfig = {
baseUrl: `${bootstrap.uriFromPath(configuration.appRoot)}/out`,
'vs/nls': nlsConfig,
nodeModules: [/*BUILD->INSERT_NODE_MODULES*/]
amdModulesPattern: /^vs\//,
};
// cached data config