mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 13:43:07 +00:00
Adopt loader's amdModulesPattern
option
This commit is contained in:
parent
bf2299cda1
commit
bb95f3aa40
4 changed files with 6 additions and 17 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 };
|
||||
|
|
2
src/bootstrap-window.js
vendored
2
src/bootstrap-window.js
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue