sourcemaps.patch 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js
  2. index 7826f48..ff0e2f0 100644
  3. --- a/build/gulpfile.extensions.js
  4. +++ b/build/gulpfile.extensions.js
  5. @@ -74,3 +74,3 @@ const compilations = [
  6. -const getBaseUrl = out => `https://main.vscode-cdn.net/sourcemaps/${commit}/${out}`;
  7. +const getBaseUrl = out => `https://github.com/VSCodium/sourcemaps/releases/download/${commit}/${out.replaceAll('/', '-')}`;
  8. diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js
  9. index 10b7b44..895b25b 100644
  10. --- a/build/gulpfile.reh.js
  11. +++ b/build/gulpfile.reh.js
  12. @@ -454,3 +454,3 @@ function tweakProductForServerWeb(product) {
  13. util.rimraf(`out-vscode-${type}-min`),
  14. - optimize.minifyTask(`out-vscode-${type}`, `https://main.vscode-cdn.net/sourcemaps/${commit}/core`)
  15. + optimize.minifyTask(`out-vscode-${type}`, `https://github.com/VSCodium/sourcemaps/releases/download/${commit}/core`)
  16. ));
  17. diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
  18. index ed06b6a..ebedfc4 100644
  19. --- a/build/gulpfile.vscode.js
  20. +++ b/build/gulpfile.vscode.js
  21. @@ -147,3 +147,3 @@ gulp.task(bundleVSCodeTask);
  22. -const sourceMappingURLBase = `https://main.vscode-cdn.net/sourcemaps/${commit}`;
  23. +const sourceMappingURLBase = `https://github.com/VSCodium/sourcemaps/releases/download/${commit}`;
  24. const minifyVSCodeTask = task.define('minify-vscode', task.series(
  25. diff --git a/build/gulpfile.vscode.web.js b/build/gulpfile.vscode.web.js
  26. index 295a977..ba0a598 100644
  27. --- a/build/gulpfile.vscode.web.js
  28. +++ b/build/gulpfile.vscode.web.js
  29. @@ -140,3 +140,3 @@ const minifyVSCodeWebTask = task.define('minify-vscode-web', task.series(
  30. util.rimraf('out-vscode-web-min'),
  31. - optimize.minifyTask('out-vscode-web', `https://main.vscode-cdn.net/sourcemaps/${commit}/core`)
  32. + optimize.minifyTask('out-vscode-web', `https://github.com/VSCodium/sourcemaps/releases/download/${commit}/core`)
  33. ));
  34. diff --git a/build/lib/extensions.js b/build/lib/extensions.js
  35. index c80a1be..000cf9f 100644
  36. --- a/build/lib/extensions.js
  37. +++ b/build/lib/extensions.js
  38. @@ -76,3 +76,3 @@ const root = path_1.default.dirname(path_1.default.dirname(__dirname));
  39. const commit = (0, getVersion_1.getVersion)(root);
  40. -const sourceMappingURLBase = `https://main.vscode-cdn.net/sourcemaps/${commit}`;
  41. +const sourceMappingURLBase = `https://github.com/VSCodium/sourcemaps/releases/download/${commit}`;
  42. function minifyExtensionResources(input) {
  43. @@ -205,3 +205,3 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) {
  44. data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
  45. - return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path_1.default.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
  46. + return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions-${path_1.default.basename(extensionPath).replaceAll('/', '-')}-${relativeOutputPath.replaceAll('/', '-')}-${g1.replaceAll('/', '-')}`;
  47. }), 'utf8');
  48. diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts
  49. index 9e7cf9f..e5f7c24 100644
  50. --- a/build/lib/extensions.ts
  51. +++ b/build/lib/extensions.ts
  52. @@ -31,3 +31,3 @@ const root = path.dirname(path.dirname(__dirname));
  53. const commit = getVersion(root);
  54. -const sourceMappingURLBase = `https://main.vscode-cdn.net/sourcemaps/${commit}`;
  55. +const sourceMappingURLBase = `https://github.com/VSCodium/sourcemaps/releases/download/${commit}`;
  56. @@ -179,3 +179,3 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string,
  57. data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
  58. - return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
  59. + return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions-${path.basename(extensionPath).replaceAll('/', '-')}-${relativeOutputPath.replaceAll('/', '-')}-${g1.replaceAll('/', '-')}`;
  60. }), 'utf8');
  61. diff --git a/build/lib/optimize.js b/build/lib/optimize.js
  62. index fbc455b..4e7fe85 100644
  63. --- a/build/lib/optimize.js
  64. +++ b/build/lib/optimize.js
  65. @@ -186,3 +186,3 @@ function bundleTask(opts) {
  66. function minifyTask(src, sourceMapBaseUrl) {
  67. - const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
  68. + const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}-${f.relative.replaceAll('/', '-')}.map`) : undefined;
  69. return cb => {
  70. diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts
  71. index d89d0d6..fca30cf 100644
  72. --- a/build/lib/optimize.ts
  73. +++ b/build/lib/optimize.ts
  74. @@ -211,3 +211,3 @@ export function bundleTask(opts: IBundleESMTaskOpts): () => NodeJS.ReadWriteStre
  75. export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => void {
  76. - const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
  77. + const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}-${f.relative.replaceAll('/', '-')}.map`) : undefined;
  78. diff --git a/build/lib/util.js b/build/lib/util.js
  79. index 389b9e0..9abdb3c 100644
  80. --- a/build/lib/util.js
  81. +++ b/build/lib/util.js
  82. @@ -235,4 +235,4 @@ function rewriteSourceMappingURL(sourceMappingURLBase) {
  83. const contents = f.contents.toString('utf8');
  84. - const str = `//# sourceMappingURL=${sourceMappingURLBase}/${path_1.default.dirname(f.relative).replace(/\\/g, '/')}/$1`;
  85. - f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, str));
  86. + const fp = path_1.default.dirname(f.relative).replace(/\\/g, '/').replaceAll('/', '-');
  87. + f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, (_m, p) => `//# sourceMappingURL=${sourceMappingURLBase}/${fp}-${p.replaceAll('/', '-')}`));
  88. return f;
  89. diff --git a/build/lib/util.ts b/build/lib/util.ts
  90. index 4931342..833091c 100644
  91. --- a/build/lib/util.ts
  92. +++ b/build/lib/util.ts
  93. @@ -285,4 +285,4 @@ export function rewriteSourceMappingURL(sourceMappingURLBase: string): NodeJS.Re
  94. const contents = (<Buffer>f.contents).toString('utf8');
  95. - const str = `//# sourceMappingURL=${sourceMappingURLBase}/${path.dirname(f.relative).replace(/\\/g, '/')}/$1`;
  96. - f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, str));
  97. + const fp = path.dirname(f.relative).replace(/\\/g, '/').replaceAll('/', '-');
  98. + f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, (_m, p) => `//# sourceMappingURL=${sourceMappingURLBase}/${fp}-${p.replaceAll('/', '-')}`));
  99. return f;