我正在分析我的角度应用程序包,我无法理解为什么在一个要素模块1.b6e2bed6d2a2d3892bd9.chunk.js
上导入rxjs,我在该模块中导入的所有内容如下所示:
import { Observable } from 'rxjs/Observable';
如何找出为什么在该模块上导入整个rxj?
答案 0 :(得分:1)
答案:
我找到了问题的根源,我正在该模块上导入customHttpProvider,我猜ng-jhipster
包拉了整个rxjs
库
import { Injector } from '@angular/core';
import { Http, RequestOptions, XHRBackend } from '@angular/http';
import { JhiInterceptableHttp } from 'ng-jhipster';
import { AuthExpiredInterceptor } from './auth-expired.interceptor';
import { ErrorHandlerInterceptor } from './errorhandler.interceptor';
import { NotificationInterceptor } from './notification.interceptor';
export function interceptableFactory(
backend: XHRBackend,
defaultOptions: RequestOptions,
injector: Injector
//stateStorageService: StateStorageService,
//eventManager: EventManager
) {
return new JhiInterceptableHttp(
backend,
defaultOptions,
[
new AuthExpiredInterceptor(injector
//, stateStorageService
),
// Other interceptors can be added here
new ErrorHandlerInterceptor(
//eventManager
),
new NotificationInterceptor()
]
);
};
export function customHttpProvider() {
return {
provide: Http,
useFactory: interceptableFactory,
deps: [
XHRBackend,
RequestOptions,
Injector,
//StateStorageService,
//EventManager
]
};
};