@@ -5,14 +5,14 @@ import { NamedLazyChunksWebpackPlugin } from '../../plugins/named-lazy-chunks-we
5
5
import { InsertConcatAssetsWebpackPlugin } from '../../plugins/insert-concat-assets-webpack-plugin' ;
6
6
import { extraEntryParser , getOutputHashFormat , AssetPattern } from './utils' ;
7
7
import { isDirectory } from '../../utilities/is-directory' ;
8
+ import { requireProjectModule } from '../../utilities/require-project-module' ;
8
9
import { WebpackConfigOptions } from '../webpack-config' ;
9
10
10
11
const ConcatPlugin = require ( 'webpack-concat-plugin' ) ;
11
12
const ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' ) ;
12
13
const CircularDependencyPlugin = require ( 'circular-dependency-plugin' ) ;
13
14
const SilentError = require ( 'silent-error' ) ;
14
15
15
-
16
16
/**
17
17
* Enumerate loaders and their dependencies from this file to let the dependency validator
18
18
* know they are used.
@@ -159,11 +159,21 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
159
159
160
160
// Read the tsconfig to determine if we should prefer ES2015 modules.
161
161
162
+ // Load rxjs path aliases.
163
+ // https://github.com/ReactiveX/rxjs/blob/master/doc/lettable-operators.md#build-and-treeshaking
164
+ let alias = { } ;
165
+ try {
166
+ const rxjsPathMappingImport = 'rxjs/_esm5/path-mapping' ;
167
+ const rxPaths = requireProjectModule ( projectRoot , rxjsPathMappingImport ) ;
168
+ alias = rxPaths ( nodeModules ) ;
169
+ } catch ( e ) { }
170
+
162
171
return {
163
172
resolve : {
164
173
extensions : [ '.ts' , '.js' ] ,
165
174
modules : [ 'node_modules' , nodeModules ] ,
166
- symlinks : ! buildOptions . preserveSymlinks
175
+ symlinks : ! buildOptions . preserveSymlinks ,
176
+ alias
167
177
} ,
168
178
resolveLoader : {
169
179
modules : [ nodeModules , 'node_modules' ]
0 commit comments