RxJs 5 - 使用webpack 4进行TreeShaking

时间:2018-02-27 13:09:49

标签: webpack rxjs rxjs5 webpack-4

我正在使用RxJS 5.5而我正在导入以下运算符:

import { mergeMap } from 'rxjs/operators';
import { fromPromise } from 'rxjs/observable/fromPromise';

自从我升级了webpack 3 - > 4,我看到导入了整个rxjs包:

enter image description here

似乎webpack中的别名配置不再起作用:

const rxPaths = require('rxjs/_esm5/path-mapping');
resolve: {
  alias: rxPaths(),
  extensions: ['.js', '.jsx'],
},

0 个答案:

没有答案