fbchen / angular4-weui

Angular-WeUI => build with Angular4
https://fbchen.github.io/angular4-weui/
MIT License
24 stars 7 forks source link

ng serve 时的循环引用报警 #2

Closed crossz closed 6 years ago

crossz commented 6 years ago

发生问题的环境是:

您做了什么?请提供尽可能详细的重现步骤。

ng serve 的时候, 报循环引用的报警,如下:

Date: 2018-01-10T03:07:06.960Z
Hash: d3726674908c7a571689
Time: 18285ms
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 1.11 MB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 626 kB [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 1.03 MB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 11.2 MB [initial] [rendered]

WARNING in Circular dependency detected:
src/app/weui/src/gallery/weui.gallery.ts -> src/app/weui/src/uploader/weui.uploader.ts -> src/app/weui/src/gallery/weui.gallery.ts

WARNING in Circular dependency detected:
src/app/weui/src/navbar/weui.navbar.item.ts -> src/app/weui/src/navbar/weui.navbar.ts -> src/app/weui/src/navbar/weui.navbar.item.ts

WARNING in Circular dependency detected:
src/app/weui/src/navbar/weui.navbar.ts -> src/app/weui/src/navbar/weui.navbar.item.ts -> src/app/weui/src/navbar/weui.navbar.ts

WARNING in Circular dependency detected:
src/app/weui/src/tabbar/weui.tabbar.item.ts -> src/app/weui/src/tabbar/weui.tabbar.ts -> src/app/weui/src/tabbar/weui.tabbar.item.ts

WARNING in Circular dependency detected:
src/app/weui/src/tabbar/weui.tabbar.ts -> src/app/weui/src/tabbar/weui.tabbar.item.ts -> src/app/weui/src/tabbar/weui.tabbar.ts

WARNING in Circular dependency detected:
src/app/weui/src/uploader/weui.uploader.ts -> src/app/weui/src/gallery/weui.gallery.ts -> src/app/weui/src/uploader/weui.uploader.ts

webpack: Compiled with warnings.

您期待的结果是:

没有这种可能存在问题的报警.

实际上的结果是:

可重现的在线演示

fbchen commented 6 years ago

The ability to show/hide circular dependency warnings was introduced and is controllable via .angular-cli.json you can see documentation about that feature here search for "showCircularDependencies"

请参考:https://github.com/angular/angular-cli/issues/7705

crossz commented 6 years ago

这个不能修复吗? 这种隐藏起来 warning, 有种掩耳盗铃的意思啊.

fbchen commented 6 years ago

这种互相引用避免不了的,比如OptionGroup <-> Option

crossz commented 6 years ago

好吧, 我还是angular 菜鸟, 待我研究研究先.