diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 810bb425c..e6a395c40 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -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()) diff --git a/tsconfig.json b/tsconfig.json index 3b1971dc5..9dbdfcfab 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,9 @@ // normally they are ignored as source files "allowJs": true, - // Generate d.ts files + // Generate d.ts files and sourcemaps. "declaration": true, + "sourceMap": true, "module": "ES2015", "moduleResolution": "node",