remove-mangle.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. diff --git a/build/lib/compilation.js b/build/lib/compilation.js
  2. index 71bc9fb..238a3b9 100644
  3. --- a/build/lib/compilation.js
  4. +++ b/build/lib/compilation.js
  5. @@ -20,3 +20,2 @@ const File = require("vinyl");
  6. const task = require("./task");
  7. -const mangleTypeScript_1 = require("./mangleTypeScript");
  8. const watch = require('./watch');
  9. @@ -103,23 +102,3 @@ function compileTask(src, out, build) {
  10. }
  11. - // mangle: TypeScript to TypeScript
  12. - let mangleStream = es.through();
  13. - if (build) {
  14. - let ts2tsMangler = new mangleTypeScript_1.Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data));
  15. - const newContentsByFileName = ts2tsMangler.computeNewFileContents();
  16. - mangleStream = es.through(function write(data) {
  17. - const newContents = newContentsByFileName.get(data.path);
  18. - if (newContents !== undefined) {
  19. - data.contents = Buffer.from(newContents.out);
  20. - data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
  21. - }
  22. - this.push(data);
  23. - }, function end() {
  24. - this.push(null);
  25. - // free resources
  26. - newContentsByFileName.clear();
  27. - ts2tsMangler = undefined;
  28. - });
  29. - }
  30. return srcPipe
  31. - .pipe(mangleStream)
  32. .pipe(generator.stream)
  33. diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts
  34. index 8e0f19a..27ea44c 100644
  35. --- a/build/lib/compilation.ts
  36. +++ b/build/lib/compilation.ts
  37. @@ -19,4 +19,2 @@ import * as File from 'vinyl';
  38. import * as task from './task';
  39. -import { Mangler } from './mangleTypeScript';
  40. -import { RawSourceMap } from 'source-map';
  41. const watch = require('./watch');
  42. @@ -123,24 +121,3 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
  43. - // mangle: TypeScript to TypeScript
  44. - let mangleStream = es.through();
  45. - if (build) {
  46. - let ts2tsMangler = new Mangler(compile.projectPath, (...data) => fancyLog(ansiColors.blue('[mangler]'), ...data));
  47. - const newContentsByFileName = ts2tsMangler.computeNewFileContents();
  48. - mangleStream = es.through(function write(data: File & { sourceMap?: RawSourceMap }) {
  49. - const newContents = newContentsByFileName.get(data.path);
  50. - if (newContents !== undefined) {
  51. - data.contents = Buffer.from(newContents.out);
  52. - data.sourceMap = newContents.sourceMap && JSON.parse(newContents.sourceMap);
  53. - }
  54. - this.push(data);
  55. - }, function end() {
  56. - this.push(null);
  57. - // free resources
  58. - newContentsByFileName.clear();
  59. - (<any>ts2tsMangler) = undefined;
  60. - });
  61. - }
  62. -
  63. return srcPipe
  64. - .pipe(mangleStream)
  65. .pipe(generator.stream)