Angular出现“Critical dependency: the request of a dependency is an expression”的警告
问题:Angular出现“Critical dependency: the request of a dependency is an expression”的警告
WARNING in ./~/@angular/core/@angular/core.es5.js Critical dependency: the request of a dependency is an expression 图例:
解决办法:
new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,utils.root('./src'), {}),
复制代码 改为:
new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/,utils.root('./src'), {}),
复制代码 上面的util是定制化的工具类,这个可以不用关注,只需要替代/angular(\|/)core(\|/)@angular/,就行
参考: Getting a warning in console when compiling Angular 4 rc 2 #14898
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
