处理方式
背景
项目采用的是CJS模块加载
解决方式
通过间接类引用,避开显式import类的这一步,达到了规避CJS下的循环依赖
参考文章
详解ES6和CJS模块加载原理
http://www.ruanyifeng.com/blog/2015/11/circular-dependency.html
https://zhuanlan.zhihu.com/p/33843378
项目采用的是CJS模块加载
通过间接类引用,避开显式import类的这一步,达到了规避CJS下的循环依赖
http://www.ruanyifeng.com/blog/2015/11/circular-dependency.html
https://zhuanlan.zhihu.com/p/33843378