Skip to content

Commit cc8f0b7

Browse files
authored
Strip sourcemaps (#7756)
This will significantly reduce the size, and for errors we should be able to map them as necessary.
1 parent 7cc2270 commit cc8f0b7

1 file changed

Lines changed: 12 additions & 30 deletions

File tree

patches/sourcemaps.diff

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,25 @@
1-
Make sourcemaps self-hosted
1+
Remove sourcemaps URL
22

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.
84

95
Index: code-server/lib/vscode/build/gulpfile.reh.ts
106
===================================================================
117
--- code-server.orig/lib/vscode/build/gulpfile.reh.ts
128
+++ 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+
1412
return () => {
13+
+ const jsFilterMain = util.filter(data => !data.isDirectory() && /\.js$/.test(data.path));
14+
+
1515
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
1616
.pipe(rename(function (path) { path.dirname = path.dirname!.replace(new RegExp('^' + sourceFolderName), 'out'); }))
17-
- .pipe(util.setExecutableBit(['**/*.sh']))
17+
.pipe(util.setExecutableBit(['**/*.sh']))
1818
- .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);
2023

2124
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
2225
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

Comments
 (0)