Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
8 changes: 2 additions & 6 deletions packages/@angular/cli/models/webpack-configs/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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({
Expand Down