mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Don't mangle fields for the monaco editor, FYI @jrieken (#177223)
This commit is contained in:
committed by
GitHub
parent
72b1ad9f24
commit
ebe458556d
@@ -85,7 +85,8 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
// Disable mangling for the editor, as it complicates debugging & quite a few users rely on private/protected fields.
|
||||||
|
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true, { disableMangle: true }));
|
||||||
|
|
||||||
const optimizeEditorAMDTask = task.define('optimize-editor-amd', optimize.optimizeTask(
|
const optimizeEditorAMDTask = task.define('optimize-editor-amd', optimize.optimizeTask(
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -106,7 +106,7 @@ export function transpileTask(src: string, out: string, swc: boolean): () => Nod
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
|
export function compileTask(src: string, out: string, build: boolean, options: { disableMangle?: boolean } = {}): () => NodeJS.ReadWriteStream {
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
|
|||||||
|
|
||||||
// mangle: TypeScript to TypeScript
|
// mangle: TypeScript to TypeScript
|
||||||
let mangleStream = es.through();
|
let mangleStream = es.through();
|
||||||
if (build) {
|
if (build && !options.disableMangle) {
|
||||||
let ts2tsMangler = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data));
|
let ts2tsMangler = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data));
|
||||||
const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
|
const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
|
||||||
mangleStream = es.through(function write(data: File & { sourceMap?: RawSourceMap }) {
|
mangleStream = es.through(function write(data: File & { sourceMap?: RawSourceMap }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user