From 1e3cef5d1b896de74a0a7da1d8e1ff05ae361c7c Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Tue, 24 May 2022 10:11:43 -0700 Subject: [PATCH] Add warning when not inlining source maps (#19490) * Add warning when not inlining source maps * more --- build/lib/compilation.js | 8 ++++++++ build/lib/compilation.ts | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/build/lib/compilation.js b/build/lib/compilation.js index fd21452243..d668d11cae 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -40,6 +40,14 @@ function createCompile(src, build, emitError) { if (!build && !process.env['SQL_NO_INLINE_SOURCEMAP']) { overrideOptions.inlineSourceMap = true; } + else if (!build) { + console.warn('********************************************************************************************'); + console.warn('* Inlining of source maps is DISABLED, which will prevent debugging from working properly, *'); + console.warn('* but is required to generate code coverage reports. *'); + console.warn('* To re-enable inlining of source maps clear the SQL_NO_INLINE_SOURCEMAP environment var *'); + console.warn('* and re-run the build/watch task *'); + console.warn('********************************************************************************************'); + } const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err)); function pipeline(token) { const bom = require('gulp-bom'); diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index 9d1b5f57c0..9bc909bbe4 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -46,6 +46,13 @@ function createCompile(src: string, build: boolean, emitError?: boolean) { const overrideOptions = { ...getTypeScriptCompilerOptions(src), inlineSources: Boolean(build) }; if (!build && !process.env['SQL_NO_INLINE_SOURCEMAP']) { overrideOptions.inlineSourceMap = true; + } else if (!build) { + console.warn('********************************************************************************************'); + console.warn('* Inlining of source maps is DISABLED, which will prevent debugging from working properly, *'); + console.warn('* but is required to generate code coverage reports. *'); + console.warn('* To re-enable inlining of source maps clear the SQL_NO_INLINE_SOURCEMAP environment var *'); + console.warn('* and re-run the build/watch task *'); + console.warn('********************************************************************************************'); } const compilation = tsb.create(projectPath, overrideOptions, false, err => reporter(err));