From 3d313aede808bd5c1b839e7927fb01a542058d02 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Fri, 22 Mar 2019 17:54:46 -0400 Subject: [PATCH] build: remove generation of inline sourcemaps --- lib/bootstrap-local.js | 13 ++++++++----- tsconfig-test.json | 6 ++++++ tsconfig.json | 6 ------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/bootstrap-local.js b/lib/bootstrap-local.js index c6ff2e45f6d9..0a18be4ee19b 100644 --- a/lib/bootstrap-local.js +++ b/lib/bootstrap-local.js @@ -23,9 +23,12 @@ const tmpRoot = temp.mkdirSync('angular-devkit-'); debugLocal('starting bootstrap local'); -const compilerOptions = ts.readConfigFile(path.join(__dirname, '../tsconfig.json'), p => { - return fs.readFileSync(p, 'utf-8'); -}).config; +// This processes any extended configs +const compilerOptions = ts.getParsedCommandLineOfConfigFile( + path.join(__dirname, '../tsconfig-test.json'), + { }, + ts.sys, +).options; let _istanbulRequireHook = null; if (process.env['CODE_COVERAGE'] || process.argv.indexOf('--code-coverage') !== -1) { @@ -33,7 +36,7 @@ if (process.env['CODE_COVERAGE'] || process.argv.indexOf('--code-coverage') !== _istanbulRequireHook = require('./istanbul-local').istanbulRequireHook; // async keyword isn't supported by the Esprima version used by Istanbul version used by us. // TODO: update istanbul to istanbul-lib-* (see http://istanbul.js.org/) and remove this hack. - compilerOptions.compilerOptions.target = 'es2016'; + compilerOptions.target = 'es2016'; } @@ -98,7 +101,7 @@ require.extensions['.ts'] = function (m, filename) { const source = fs.readFileSync(filename).toString(); try { - let result = ts.transpile(source, compilerOptions['compilerOptions'], filename); + let result = ts.transpile(source, compilerOptions, filename); if (_istanbulRequireHook) { result = _istanbulRequireHook(result, filename); diff --git a/tsconfig-test.json b/tsconfig-test.json index a9676fb36c2d..2744f98d1e3f 100644 --- a/tsconfig-test.json +++ b/tsconfig-test.json @@ -1,6 +1,12 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "inlineSourceMap": true, + "sourceRoot": ".", + // Inline sources are necessary for our tests to show the proper sources, since we are using + // Istanbul (not Constantinople) as well, and applying both source maps to get the original + // source in devtools. + "inlineSources": true, "types": [ "node", "jasmine" diff --git a/tsconfig.json b/tsconfig.json index 1b04987d77f1..c497c7935817 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,12 +15,6 @@ "rootDir": ".", "skipDefaultLibCheck": true, "skipLibCheck": true, - "inlineSourceMap": true, - "sourceRoot": ".", - // Inline sources are necessary for our tests to show the proper sources, since we are using - // Istanbul (not Constantinople) as well, and applying both source maps to get the original - // source in devtools. - "inlineSources": true, "strictNullChecks": true, "target": "es2017", "lib": [