mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-23 11:30:14 +10:00
refactor: patches (#2797)
This commit is contained in:
32
patches/00-build-disable-mangle.patch
Normal file
32
patches/00-build-disable-mangle.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts
|
||||
index 948c6b4..66ecdd3 100644
|
||||
--- a/build/lib/compilation.ts
|
||||
+++ b/build/lib/compilation.ts
|
||||
@@ -131,27 +131,3 @@ export function compileTask(src: string, out: string, build: boolean, options: {
|
||||
|
||||
- // mangle: TypeScript to TypeScript
|
||||
- let mangleStream = es.through();
|
||||
- if (build && !options.disableMangle) {
|
||||
- let ts2tsMangler: Mangler | undefined = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data), { mangleExports: true, manglePrivateFields: true });
|
||||
- const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
|
||||
- mangleStream = es.through(async function write(data: File & { sourceMap?: RawSourceMap }) {
|
||||
- type TypeScriptExt = typeof ts & { normalizePath(path: string): string };
|
||||
- const tsNormalPath = (ts as TypeScriptExt).normalizePath(data.path);
|
||||
- const newContents = (await newContentsByFileName).get(tsNormalPath);
|
||||
- if (newContents !== undefined) {
|
||||
- data.contents = Buffer.from(newContents.out);
|
||||
- data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
|
||||
- }
|
||||
- this.push(data);
|
||||
- }, async function end() {
|
||||
- // free resources
|
||||
- (await newContentsByFileName).clear();
|
||||
-
|
||||
- this.push(null);
|
||||
- ts2tsMangler = undefined;
|
||||
- });
|
||||
- }
|
||||
-
|
||||
return srcPipe
|
||||
- .pipe(mangleStream)
|
||||
.pipe(generator.stream)
|
||||
Reference in New Issue
Block a user