vscodium/patches/remove-mangle.patch

62 lines
2.8 KiB
Diff
Raw Normal View History

2023-01-29 11:42:40 -05:00
diff --git a/build/lib/compilation.js b/build/lib/compilation.js
2023-07-06 18:10:45 -04:00
index 2270e05..1bd7b90 100644
2023-01-29 11:42:40 -05:00
--- a/build/lib/compilation.js
+++ b/build/lib/compilation.js
2023-07-06 18:10:45 -04:00
@@ -104,24 +104,3 @@ function compileTask(src, out, build, options = {}) {
2023-01-29 11:42:40 -05:00
}
- // mangle: TypeScript to TypeScript
- let mangleStream = es.through();
2023-03-18 20:26:17 -04:00
- if (build && !options.disableMangle) {
2023-07-06 18:10:45 -04:00
- let ts2tsMangler = new index_1.Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data), { mangleExports: true, manglePrivateFields: true });
2023-03-02 17:40:15 -05:00
- const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
2023-07-06 18:10:45 -04:00
- mangleStream = es.through(async function write(data) {
2023-03-02 17:23:03 -05:00
- const tsNormalPath = ts.normalizePath(data.path);
2023-07-06 18:10:45 -04:00
- const newContents = (await newContentsByFileName).get(tsNormalPath);
2023-01-29 11:42:40 -05:00
- if (newContents !== undefined) {
- data.contents = Buffer.from(newContents.out);
- data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
- }
- this.push(data);
2023-07-06 18:10:45 -04:00
- }, async function end() {
2023-01-29 11:42:40 -05:00
- // free resources
2023-07-06 18:10:45 -04:00
- (await newContentsByFileName).clear();
- this.push(null);
2023-01-29 11:42:40 -05:00
- ts2tsMangler = undefined;
- });
- }
return srcPipe
- .pipe(mangleStream)
.pipe(generator.stream)
diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts
2023-07-06 18:10:45 -04:00
index d5da3f1..fa46962 100644
2023-01-29 11:42:40 -05:00
--- a/build/lib/compilation.ts
+++ b/build/lib/compilation.ts
2023-07-06 18:10:45 -04:00
@@ -123,27 +123,3 @@ export function compileTask(src: string, out: string, build: boolean, options: {
2023-01-29 11:42:40 -05:00
- // mangle: TypeScript to TypeScript
- let mangleStream = es.through();
2023-03-18 20:26:17 -04:00
- if (build && !options.disableMangle) {
2023-07-06 18:10:45 -04:00
- let ts2tsMangler = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data), { mangleExports: true, manglePrivateFields: true });
2023-03-02 17:40:15 -05:00
- const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
2023-07-06 18:10:45 -04:00
- mangleStream = es.through(async function write(data: File & { sourceMap?: RawSourceMap }) {
2023-03-02 17:23:03 -05:00
- type TypeScriptExt = typeof ts & { normalizePath(path: string): string };
- const tsNormalPath = (<TypeScriptExt>ts).normalizePath(data.path);
2023-07-06 18:10:45 -04:00
- const newContents = (await newContentsByFileName).get(tsNormalPath);
2023-01-29 11:42:40 -05:00
- if (newContents !== undefined) {
- data.contents = Buffer.from(newContents.out);
- data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
- }
- this.push(data);
2023-07-06 18:10:45 -04:00
- }, async function end() {
2023-01-29 11:42:40 -05:00
- // free resources
2023-07-06 18:10:45 -04:00
- (await newContentsByFileName).clear();
-
- this.push(null);
2023-01-29 11:42:40 -05:00
- (<any>ts2tsMangler) = undefined;
- });
- }
-
return srcPipe
- .pipe(mangleStream)
.pipe(generator.stream)