forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.editor.js
98 lines (80 loc) · 3.65 KB
/
gulpfile.editor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var gulp = require('gulp');
var rename = require('gulp-rename');
var filter = require('gulp-filter');
var _ = require('underscore');
var es = require('event-stream');
var buildfile = require('./src/buildfile');
var util = require('./build/lib/util');
var common = require('./gulpfile.common');
// Build
var editorEntryPoints = _.flatten([
buildfile.entrypoint('vs/editor/editor.main'),
buildfile.base,
buildfile.standaloneLanguages,
buildfile.editor,
buildfile.languages
]);
var editorResources = [
'out-build/vs/css.js',
'out-build/vs/nls.js',
'out-build/vs/text.js',
'out-build/vs/{base,editor}/**/*.{svg,png}',
'out-build/vs/editor/css/*.css',
'out-build/vs/base/worker/workerMainCompatibility.html',
'out-build/vs/base/worker/workerMain.{js,js.map}',
'out-build/vs/languages/typescript/common/lib/lib.{d.ts,es6.d.ts}',
'!out-build/vs/workbench/**',
'!**/test/**'
];
function editorLoaderConfig(removeAllOSS) {
var result = common.loaderConfig();
// never ship marked in editor
result.paths['vs/languages/markdown/common/marked'] = 'out-build/vs/languages/markdown/common/marked.mock';
if (removeAllOSS) {
result.paths['vs/languages/lib/common/beautify-html'] = 'out-build/vs/languages/lib/common/beautify-html.mock';
}
return result;
}
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-build'], common.optimizeTask(
editorEntryPoints,
editorResources,
editorLoaderConfig(false),
'out-editor'
));
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
// OSS Free
gulp.task('clean-optimized-editor-ossfree', util.rimraf('out-editor-ossfree'));
gulp.task('optimize-editor-ossfree', ['clean-optimized-editor-ossfree', 'compile-build'], common.optimizeTask(
editorEntryPoints,
editorResources,
editorLoaderConfig(true),
'out-editor-ossfree'
));
gulp.task('clean-minified-editor-ossfree', util.rimraf('out-editor-ossfree-min'));
gulp.task('minify-editor-ossfree', ['clean-minified-editor-ossfree', 'optimize-editor-ossfree'], common.minifyTask('out-editor-ossfree'));
// Package
function editorTask(out, dest) {
return function () {
return gulp.src(out + '/**', { base: out })
.pipe(filter(['**', '!**/*.js.map', '!**/bundles.json']))
.pipe(gulp.dest(dest));
};
}
gulp.task('clean-editor', util.rimraf('../Monaco-Editor-Build'));
gulp.task('editor', ['clean-editor', 'optimize-editor'],
editorTask('out-editor', '../Monaco-Editor-Build'));
gulp.task('clean-editor-min', util.rimraf('../Monaco-Editor-Build-Min'));
gulp.task('editor-min', ['clean-editor-min', 'minify-editor'],
editorTask('out-editor-min', '../Monaco-Editor-Build-Min'));
gulp.task('clean-editor-ossfree', util.rimraf('../Monaco-Editor-Build-OSS-Free'));
gulp.task('editor-ossfree', ['clean-editor-ossfree', 'optimize-editor-ossfree'],
editorTask('out-editor-ossfree', '../Monaco-Editor-Build-OSS-Free'));
gulp.task('clean-editor-ossfree-min', util.rimraf('../Monaco-Editor-Build-OSS-Free-Min'));
gulp.task('editor-ossfree-min', ['clean-editor-ossfree-min', 'minify-editor-ossfree'],
editorTask('out-editor-ossfree-min', '../Monaco-Editor-Build-OSS-Free-Min'));