@@ -8,8 +8,6 @@ import { PurifyPlugin } from '@angular-devkit/build-optimizer';
8
8
import { StaticAssetPlugin } from '../../plugins/static-asset' ;
9
9
import { GlobCopyWebpackPlugin } from '../../plugins/glob-copy-webpack-plugin' ;
10
10
import { WebpackConfigOptions } from '../webpack-config' ;
11
- import { readTsconfig } from '../../utilities/read-tsconfig' ;
12
- import { requireProjectModule } from '../../utilities/require-project-module' ;
13
11
14
12
const UglifyJSPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
15
13
@@ -24,8 +22,6 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
24
22
export function getProdConfig ( wco : WebpackConfigOptions ) {
25
23
const { projectRoot, buildOptions, appConfig } = wco ;
26
24
27
- const projectTs = requireProjectModule ( projectRoot , 'typescript' ) ;
28
-
29
25
let extraPlugins : any [ ] = [ ] ;
30
26
let entryPoints : { [ key : string ] : string [ ] } = { } ;
31
27
@@ -123,12 +119,6 @@ export function getProdConfig(wco: WebpackConfigOptions) {
123
119
uglifyCompressOptions . passes = 3 ;
124
120
}
125
121
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
-
132
122
return {
133
123
entry : entryPoints ,
134
124
plugins : [
@@ -140,7 +130,7 @@ export function getProdConfig(wco: WebpackConfigOptions) {
140
130
new UglifyJSPlugin ( {
141
131
sourceMap : buildOptions . sourcemaps ,
142
132
uglifyOptions : {
143
- ecma : supportES2015 ? 6 : 5 ,
133
+ ecma : wco . supportES2015 ? 6 : 5 ,
144
134
warnings : buildOptions . verbose ,
145
135
ie8 : false ,
146
136
mangle : true ,
0 commit comments