|
1 | | -Make sourcemaps self-hosted |
| 1 | +Remove sourcemaps URL |
2 | 2 |
|
3 | | -Normally source maps get removed as part of the build process so prevent that |
4 | | -from happening. Also avoid using the windows.net host since obviously we can |
5 | | -not host our source maps there and want them to be self-hosted even if we could. |
6 | | - |
7 | | -To test try debugging/browsing the source of a build in a browser. |
| 3 | +These will not work since we patch VS Code. |
8 | 4 |
|
9 | 5 | Index: code-server/lib/vscode/build/gulpfile.reh.ts |
10 | 6 | =================================================================== |
11 | 7 | --- code-server.orig/lib/vscode/build/gulpfile.reh.ts |
12 | 8 | +++ code-server/lib/vscode/build/gulpfile.reh.ts |
13 | | -@@ -263,8 +263,7 @@ function packageTask(type: string, platf |
| 9 | +@@ -261,10 +261,15 @@ function packageTask(type: string, platf |
| 10 | + const destination = path.join(BUILD_ROOT, destinationFolderName); |
| 11 | + |
14 | 12 | return () => { |
| 13 | ++ const jsFilterMain = util.filter(data => !data.isDirectory() && /\.js$/.test(data.path)); |
| 14 | ++ |
15 | 15 | const src = gulp.src(sourceFolderName + '/**', { base: '.' }) |
16 | 16 | .pipe(rename(function (path) { path.dirname = path.dirname!.replace(new RegExp('^' + sourceFolderName), 'out'); })) |
17 | | -- .pipe(util.setExecutableBit(['**/*.sh'])) |
| 17 | + .pipe(util.setExecutableBit(['**/*.sh'])) |
18 | 18 | - .pipe(filter(['**', '!**/*.{js,css}.map'])); |
19 | | -+ .pipe(util.setExecutableBit(['**/*.sh'])); |
| 19 | ++ .pipe(filter(['**', '!**/*.{js,css}.map'])) |
| 20 | ++ .pipe(jsFilterMain) |
| 21 | ++ .pipe(util.stripSourceMappingURL()) |
| 22 | ++ .pipe(jsFilterMain.restore); |
20 | 23 |
|
21 | 24 | const workspaceExtensionPoints = ['debuggers', 'jsonValidation']; |
22 | 25 | const isUIExtension = (manifest: { extensionKind?: string; main?: string; contributes?: Record<string, unknown> }) => { |
23 | | -@@ -304,9 +303,9 @@ function packageTask(type: string, platf |
24 | | - .map(name => `.build/extensions/${name}/**`); |
25 | | - |
26 | | - const extensions = gulp.src(extensionPaths, { base: '.build', dot: true }); |
27 | | -- const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true }); |
28 | | -- const sources = es.merge(src, extensions, extensionsCommonDependencies) |
29 | | -+ const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true }) |
30 | | - .pipe(filter(['**', '!**/*.{js,css}.map'], { dot: true })); |
31 | | -+ const sources = es.merge(src, extensions, extensionsCommonDependencies); |
32 | | - |
33 | | - let version = packageJson.version; |
34 | | - const quality = (product as typeof product & { quality?: string }).quality; |
35 | | -@@ -505,7 +504,7 @@ function tweakProductForServerWeb(produc |
36 | | - const minifyTask = task.define(`minify-vscode-${type}`, task.series( |
37 | | - bundleTask, |
38 | | - util.rimraf(`out-vscode-${type}-min`), |
39 | | -- optimize.minifyTask(`out-vscode-${type}`, `https://main.vscode-cdn.net/sourcemaps/${commit}/core`) |
40 | | -+ optimize.minifyTask(`out-vscode-${type}`, ``) |
41 | | - )); |
42 | | - gulp.task(minifyTask); |
43 | | - |
0 commit comments