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) {
30
30
const appRoot = path . resolve ( projectRoot , appConfig . root ) ;
31
31
const nodeModules = path . resolve ( projectRoot , 'node_modules' ) ;
32
32
33
+ const projectTs = requireProjectModule ( projectRoot , 'typescript' ) ;
34
+
33
35
let extraPlugins : any [ ] = [ ] ;
34
36
let extraRules : any [ ] = [ ] ;
35
37
let entryPoints : { [ key : string ] : string [ ] } = { } ;
@@ -161,9 +163,16 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
161
163
162
164
// Load rxjs path aliases.
163
165
// 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
+
164
171
let alias = { } ;
165
172
try {
166
- const rxjsPathMappingImport = 'rxjs/_esm5/path-mapping' ;
173
+ const rxjsPathMappingImport = supportES2015
174
+ ? 'rxjs/_esm2015/path-mapping'
175
+ : 'rxjs/_esm5/path-mapping' ;
167
176
const rxPaths = requireProjectModule ( projectRoot , rxjsPathMappingImport ) ;
168
177
alias = rxPaths ( nodeModules ) ;
169
178
} catch ( e ) { }
You can’t perform that action at this time.
0 commit comments