mirror of https://github.com/microsoft/vscode.git
Adopt changes in gulp.src
This commit is contained in:
parent
f9da04c392
commit
f88e4f457a
|
@ -48,9 +48,6 @@ var editorResources = [
|
|||
'!**/test/**'
|
||||
];
|
||||
|
||||
var editorOtherSources = [
|
||||
];
|
||||
|
||||
var BUNDLED_FILE_HEADER = [
|
||||
'/*!-----------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
|
@ -107,7 +104,6 @@ compileEditorAMDTask.displayName = 'compile-editor-amd';
|
|||
const optimizeEditorAMDTask = common.optimizeTask({
|
||||
src: 'out-editor-build',
|
||||
entryPoints: editorEntryPoints,
|
||||
otherSources: editorOtherSources,
|
||||
resources: editorResources,
|
||||
loaderConfig: {
|
||||
paths: {
|
||||
|
|
|
@ -95,7 +95,6 @@ const optimizeVSCodeTask = util.task.series(
|
|||
common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
otherSources: [],
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
|
@ -311,7 +310,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
|||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||
.pipe(json(productJsonUpdate));
|
||||
|
||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||
|
||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
||||
|
||||
|
@ -404,7 +403,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
|||
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||
|
||||
if (platform === 'win32') {
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||
.pipe(replace('@@NAME@@', product.nameShort))
|
||||
|
|
|
@ -114,7 +114,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
|
|||
function optimizeTask(opts) {
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const otherSources = opts.otherSources;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
|
@ -137,7 +136,7 @@ function optimizeTask(opts) {
|
|||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
const bundleInfoArray = [];
|
||||
if (opts.bundleInfo) {
|
||||
bundleInfoArray.push(new VinylFile({
|
||||
|
@ -148,20 +147,7 @@ function optimizeTask(opts) {
|
|||
}
|
||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
const otherSourcesStream = es.through();
|
||||
const otherSourcesStreamArr = [];
|
||||
gulp.src(otherSources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
}
|
||||
else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||
return result
|
||||
.pipe(sourcemaps.write('./', {
|
||||
sourceRoot: undefined,
|
||||
|
|
|
@ -142,10 +142,6 @@ export interface IOptimizeTaskOpts {
|
|||
* (for AMD files, will get bundled and get Copyright treatment)
|
||||
*/
|
||||
entryPoints: bundle.IEntryPoint[];
|
||||
/**
|
||||
* (for non-AMD files that should get Copyright treatment)
|
||||
*/
|
||||
otherSources: string[];
|
||||
/**
|
||||
* (svg, etc.)
|
||||
*/
|
||||
|
@ -176,7 +172,6 @@ export interface IOptimizeTaskOpts {
|
|||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const otherSources = opts.otherSources;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
|
@ -201,7 +196,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
|
||||
const bundleInfoArray: VinylFile[] = [];
|
||||
if (opts.bundleInfo) {
|
||||
|
@ -214,24 +209,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
|
||||
const otherSourcesStream = es.through();
|
||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
||||
|
||||
gulp.src(otherSources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
} else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
|
||||
const result = es.merge(
|
||||
loader(src, bundledFileHeader, bundleLoader),
|
||||
bundlesStream,
|
||||
otherSourcesStream,
|
||||
resourcesStream,
|
||||
bundleInfoStream
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue