File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/@angular/cli/models/webpack-configs Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
3030 const appRoot = path . resolve ( projectRoot , appConfig . root ) ;
3131 const nodeModules = path . resolve ( projectRoot , 'node_modules' ) ;
3232
33+ const projectTs = requireProjectModule ( projectRoot , 'typescript' ) ;
34+
3335 let extraPlugins : any [ ] = [ ] ;
3436 let extraRules : any [ ] = [ ] ;
3537 let entryPoints : { [ key : string ] : string [ ] } = { } ;
@@ -161,9 +163,16 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
161163
162164 // Load rxjs path aliases.
163165 // https://github.com/ReactiveX/rxjs/blob/master/doc/lettable-operators.md#build-and-treeshaking
166+
167+ const supportES2015 =
168+ wco . tsConfig . options . target !== projectTs . ScriptTarget . ES3 &&
169+ wco . tsConfig . options . target !== projectTs . ScriptTarget . ES5 ;
170+
164171 let alias = { } ;
165172 try {
166- const rxjsPathMappingImport = 'rxjs/_esm5/path-mapping' ;
173+ const rxjsPathMappingImport = supportES2015
174+ ? 'rxjs/_esm2015/path-mapping'
175+ : 'rxjs/_esm5/path-mapping' ;
167176 const rxPaths = requireProjectModule ( projectRoot , rxjsPathMappingImport ) ;
168177 alias = rxPaths ( nodeModules ) ;
169178 } catch ( e ) { }
You can’t perform that action at this time.
0 commit comments