From 7d3c2b37ff87755d59b2a361b08ab2ac4cabaacf Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Thu, 19 Oct 2017 15:51:30 +0100 Subject: [PATCH] refactor(@angular/cli): cleanup leftover tsconfig reading logic Followup to #7937 --- packages/@angular/cli/models/webpack-configs/common.ts | 2 -- .../@angular/cli/models/webpack-configs/production.ts | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/@angular/cli/models/webpack-configs/common.ts b/packages/@angular/cli/models/webpack-configs/common.ts index 108b7ee3c735..209c08af6a47 100644 --- a/packages/@angular/cli/models/webpack-configs/common.ts +++ b/packages/@angular/cli/models/webpack-configs/common.ts @@ -157,8 +157,6 @@ export function getCommonConfig(wco: WebpackConfigOptions) { extraPlugins.push(new NamedLazyChunksWebpackPlugin()); } - // Read the tsconfig to determine if we should prefer ES2015 modules. - return { resolve: { extensions: ['.ts', '.js'], diff --git a/packages/@angular/cli/models/webpack-configs/production.ts b/packages/@angular/cli/models/webpack-configs/production.ts index 30946c21f763..d50f6da1372a 100644 --- a/packages/@angular/cli/models/webpack-configs/production.ts +++ b/packages/@angular/cli/models/webpack-configs/production.ts @@ -9,7 +9,6 @@ import { PurifyPlugin } from '@angular-devkit/build-optimizer'; import { StaticAssetPlugin } from '../../plugins/static-asset'; import { GlobCopyWebpackPlugin } from '../../plugins/glob-copy-webpack-plugin'; import { WebpackConfigOptions } from '../webpack-config'; -import { readTsconfig } from '../../utilities/read-tsconfig'; const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); @@ -121,11 +120,8 @@ export function getProdConfig(wco: WebpackConfigOptions) { uglifyCompressOptions.passes = 3; } - // Read the tsconfig to determine if we should apply ES6 uglify. - const tsconfigPath = path.resolve(projectRoot, appConfig.root, appConfig.tsconfig); - const tsConfig = readTsconfig(tsconfigPath); - const supportES2015 = tsConfig.options.target !== ts.ScriptTarget.ES3 - && tsConfig.options.target !== ts.ScriptTarget.ES5; + const supportES2015 = wco.tsConfig.options.target !== ts.ScriptTarget.ES3 + && wco.tsConfig.options.target !== ts.ScriptTarget.ES5; if (supportES2015) { extraPlugins.push(new UglifyJSPlugin({