<commit_before>/*---------------------------------------------------------------------------------------------
 *  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 fs = require('fs');
var path = require('path');
var os = require('os');
var es = require('event-stream');
var azure = require('gulp-azure-storage');
var electron = require('gulp-atom-electron');
var symdest = require('gulp-symdest');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var filter = require('gulp-filter');
var json = require('gulp-json-editor');
var remote = require('gulp-remote-src');
var shell = require("gulp-shell");
var _ = require('underscore');
var packageJson = require('../package.json');
var shrinkwrap = require('../npm-shrinkwrap.json');
var util = require('./lib/util');
var buildfile = require('../src/buildfile');
var common = require('./gulpfile.common');
var nlsDev = require('vscode-nls-dev');
var root = path.dirname(__dirname);
var build = path.join(root, '.build');
var commit = util.getVersion(root);

var baseModules = [
	'applicationinsights', 'assert', 'child_process', 'chokidar', 'crypto', 'emmet',
	'events', 'fs', 'getmac', 'glob', 'graceful-fs', 'http', 'http-proxy-agent',
	'https', 'https-proxy-agent', 'iconv-lite', 'electron', 'net',
	'os', 'path', 'readline', 'sax', 'semver', 'stream', 'string_decoder', 'url',
	'vscode-textmate', 'winreg', 'yauzl', 'native-keymap', 'zlib'
];

// Build

var vscodeEntryPoints = _.flatten([
	buildfile.entrypoint('vs/workbench/workbench.main'),
	buildfile.base,
	buildfile.editor,
	buildfile.languages,
	buildfile.vscode
]);

var vscodeResources = [
	'out-build/main.js',
	'out-build/cli.js',
	'out-build/bootstrap.js',
	'out-build/bootstrap-amd.js',
	'out-build/vs/**/*.{svg,png,cur}',
	'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}',
	'out-build/vs/base/worker/workerMainCompatibility.html',
	'out-build/vs/base/worker/workerMain.{js,js.map}',
	'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
	'out-build/vs/languages/markdown/common/*.css',
	'out-build/vs/workbench/browser/media/*-theme.css',
	'out-build/vs/workbench/electron-browser/index.html',
	'out-build/vs/workbench/parts/debug/**/*.json',
	'out-build/vs/workbench/parts/execution/**/*.scpt',
	'out-build/vs/workbench/parts/git/**/*.html',
	'out-build/vs/workbench/parts/git/**/*.sh',
	'out-build/vs/workbench/parts/markdown/**/*.md',
	'out-build/vs/workbench/parts/tasks/**/*.json',
	'out-build/vs/workbench/services/files/**/*.exe',
	'out-build/vs/workbench/services/files/**/*.md',
	'!**/test/**'
];

var BUNDLED_FILE_HEADER = [
	'/*!--------------------------------------------------------',
	' * Copyright (C) Microsoft Corporation. All rights reserved.',
	' *--------------------------------------------------------*/'
].join('\n');

gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
	entryPoints: vscodeEntryPoints,
	otherSources: [],
	resources: vscodeResources,<commit_msg>Webview does not work in built version of VS Code (fixes #5736)<commit_after>/*---------------------------------------------------------------------------------------------
 *  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 fs = require('fs');
var path = require('path');
var os = require('os');
var es = require('event-stream');
var azure = require('gulp-azure-storage');
var electron = require('gulp-atom-electron');
var symdest = require('gulp-symdest');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var filter = require('gulp-filter');
var json = require('gulp-json-editor');
var remote = require('gulp-remote-src');
var shell = require("gulp-shell");
var _ = require('underscore');
var packageJson = require('../package.json');
var shrinkwrap = require('../npm-shrinkwrap.json');
var util = require('./lib/util');
var buildfile = require('../src/buildfile');
var common = require('./gulpfile.common');
var nlsDev = require('vscode-nls-dev');
var root = path.dirname(__dirname);
var build = path.join(root, '.build');
var commit = util.getVersion(root);

var baseModules = [
	'applicationinsights', 'assert', 'child_process', 'chokidar', 'crypto', 'emmet',
	'events', 'fs', 'getmac', 'glob', 'graceful-fs', 'http', 'http-proxy-agent',
	'https', 'https-proxy-agent', 'iconv-lite', 'electron', 'net',
	'os', 'path', 'readline', 'sax', 'semver', 'stream', 'string_decoder', 'url',
	'vscode-textmate', 'winreg', 'yauzl', 'native-keymap', 'zlib'
];

// Build

var vscodeEntryPoints = _.flatten([
	buildfile.entrypoint('vs/workbench/workbench.main'),
	buildfile.base,
	buildfile.editor,
	buildfile.languages,
	buildfile.vscode
]);

var vscodeResources = [
	'out-build/main.js',
	'out-build/cli.js',
	'out-build/bootstrap.js',
	'out-build/bootstrap-amd.js',
	'out-build/vs/**/*.{svg,png,cur}',
	'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh}',
	'out-build/vs/base/worker/workerMainCompatibility.html',
	'out-build/vs/base/worker/workerMain.{js,js.map}',
	'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
	'out-build/vs/languages/markdown/common/*.css',
	'out-build/vs/workbench/browser/media/*-theme.css',
	'out-build/vs/workbench/electron-browser/index.html',
	'out-build/vs/workbench/parts/debug/**/*.json',
	'out-build/vs/workbench/parts/execution/**/*.scpt',
	'out-build/vs/workbench/parts/git/**/*.html',
	'out-build/vs/workbench/parts/git/**/*.sh',
	'out-build/vs/workbench/parts/html/browser/webview.html',
	'out-build/vs/workbench/parts/markdown/**/*.md',
	'out-build/vs/workbench/parts/tasks/**/*.json',
	'out-build/vs/workbench/services/files/**/*.exe',
	'out-build/vs/workbench/services/files/**/*.md',
	'!**/test/**'
];

var BUNDLED_FILE_HEADER = [
	'/*!--------------------------------------------------------',
	' * Copyright (C) Microsoft Corporation. All rights reserved.',
	' *--------------------------------------------------------*/'
].join('\n');

gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
	entryPoints: vscodeEntryPoints,
	otherSources: [],
	resources: vscodeResources,
{'fraction_non_alphanumeric': 0.2826635028918879, 'fraction_numerical': 0.0005932077710218003, 'mean_word_length': 3.215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5252087', 'n_tokens_mistral': 2244, 'n_tokens_neox': 2231, 'n_words': 373}