mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
fix(build): Fix sourcemaps (#6352)
Get sourcemaps working again. - The change in tsconfig.json is sufficient to get functional, per-.ts-file sourcemaps in build/src/** that work in uncompiled mode (i.e. in the playground / tests). - No further changes are required for these to be ingested by gulp + Closure Compiler; the resulting files - build/*_compressed.js.map - now point at files in core/, blocks/, etc. This works correctly when packaged and also when doing local testing in compiled mode of the checked-in build products (i.e., after they are copied to the repository root.) - In order to get sourcemaps to work for local testing in compiled mode of the build products directly from build/, buildCompile now creates symlinks from build/ to core/, blocks/ and generators/.
This commit is contained in:
committed by
GitHub
parent
e9920a54e0
commit
e10bf99936
@@ -630,6 +630,15 @@ function buildCompiled() {
|
||||
// option to Closure Compiler; instead feed them as input via gulp.src.
|
||||
};
|
||||
|
||||
// Symlink source dirs from build dir so that sourcemaps work in
|
||||
// compiled-mode testing.
|
||||
for (const src of ['core', 'blocks', 'generators']) {
|
||||
const target = `${BUILD_DIR}/${src}`
|
||||
if (!fs.existsSync(target)) {
|
||||
fs.symlinkSync(`../${src}`, target);
|
||||
}
|
||||
}
|
||||
|
||||
// Fire up compilation pipline.
|
||||
return gulp.src(chunkOptions.js, {base: './'})
|
||||
.pipe(stripApacheLicense())
|
||||
|
||||
Reference in New Issue
Block a user