mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-13 20:28:18 +10:00
67 lines
3.1 KiB
Diff
67 lines
3.1 KiB
Diff
diff --git a/build/lib/compilation.js b/build/lib/compilation.js
|
|
index 61a6d28..831b7c2 100644
|
|
--- a/build/lib/compilation.js
|
|
+++ b/build/lib/compilation.js
|
|
@@ -145,24 +145,3 @@ function compileTask(src, out, build, options = {}) {
|
|
}
|
|
- // mangle: TypeScript to TypeScript
|
|
- let mangleStream = event_stream_1.default.through();
|
|
- if (build && !options.disableMangle) {
|
|
- let ts2tsMangler = new index_1.Mangler(compile.projectPath, (...data) => (0, fancy_log_1.default)(ansi_colors_1.default.blue('[mangler]'), ...data), { mangleExports: true, manglePrivateFields: true });
|
|
- const newContentsByFileName = ts2tsMangler.computeNewFileContents(new Set(['saveState']));
|
|
- mangleStream = event_stream_1.default.through(async function write(data) {
|
|
- const tsNormalPath = ts.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)
|
|
diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts
|
|
index a1de9f1..084fd2f 100644
|
|
--- a/build/lib/compilation.ts
|
|
+++ b/build/lib/compilation.ts
|
|
@@ -18,4 +18,2 @@ import File from 'vinyl';
|
|
import * as task from './task';
|
|
-import { Mangler } from './mangle/index';
|
|
-import { RawSourceMap } from 'source-map';
|
|
import ts = require('typescript');
|
|
@@ -133,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 = 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 = (<TypeScriptExt>ts).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);
|
|
- (<any>ts2tsMangler) = undefined;
|
|
- });
|
|
- }
|
|
-
|
|
return srcPipe
|
|
- .pipe(mangleStream)
|
|
.pipe(generator.stream)
|