环境
webpack 4.14.0
typescript 3.0.1
rxjs 6.3.3
第一种引入方式
var Observable = require('rxjs/Observable').Observable;
// patch Observable with appropriate methods
报错:
Module not found: Error: Can't resolve 'rxjs-compat' in 'D:\project\ztEditor\node_modules\rxjs'
第二种引入方式
import { Observable} from 'rxjs/Observable';
报错
TS2305: Module '"D:/project/ztEditor/node_modules/rxjs/Observable"' has no exported member 'Observable'.
正确的引入方式
import { Observable, Subject, ReplaySubject, from, of, range } from 'rxjs';
import { map, filter, switchMap } from 'rxjs/operators';