@@ -8,8 +8,6 @@ import { PurifyPlugin } from '@angular-devkit/build-optimizer';
88import { StaticAssetPlugin } from '../../plugins/static-asset' ;
99import { GlobCopyWebpackPlugin } from '../../plugins/glob-copy-webpack-plugin' ;
1010import { WebpackConfigOptions } from '../webpack-config' ;
11- import { readTsconfig } from '../../utilities/read-tsconfig' ;
12- import { requireProjectModule } from '../../utilities/require-project-module' ;
1311
1412const UglifyJSPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
1513
@@ -24,8 +22,6 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
2422export function getProdConfig ( wco : WebpackConfigOptions ) {
2523 const { projectRoot, buildOptions, appConfig } = wco ;
2624
27- const projectTs = requireProjectModule ( projectRoot , 'typescript' ) ;
28-
2925 let extraPlugins : any [ ] = [ ] ;
3026 let entryPoints : { [ key : string ] : string [ ] } = { } ;
3127
@@ -123,12 +119,6 @@ export function getProdConfig(wco: WebpackConfigOptions) {
123119 uglifyCompressOptions . passes = 3 ;
124120 }
125121
126- // Read the tsconfig to determine if we should apply ES6 uglify.
127- const tsconfigPath = path . resolve ( projectRoot , appConfig . root , appConfig . tsconfig ) ;
128- const tsConfig = readTsconfig ( tsconfigPath ) ;
129- const supportES2015 = tsConfig . options . target !== projectTs . ScriptTarget . ES3
130- && tsConfig . options . target !== projectTs . ScriptTarget . ES5 ;
131-
132122 return {
133123 entry : entryPoints ,
134124 plugins : [
@@ -140,7 +130,7 @@ export function getProdConfig(wco: WebpackConfigOptions) {
140130 new UglifyJSPlugin ( {
141131 sourceMap : buildOptions . sourcemaps ,
142132 uglifyOptions : {
143- ecma : supportES2015 ? 6 : 5 ,
133+ ecma : wco . supportES2015 ? 6 : 5 ,
144134 warnings : buildOptions . verbose ,
145135 ie8 : false ,
146136 mangle : true ,
0 commit comments