关键依赖:依赖的请求是一个表达式(core.es5.js)

时间:2018-01-11 20:35:40

标签: angular webpack

我正在使用angular 4.4.6和webpack 3.10.0,我收到以下警告:

WARNING in ./node_modules/@angular/core/@angular/core.es5.js
2885:201-222 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/@angular/core/@angular/core.es5.js
 @ ./ClientApp/boot.browser.ts
 @ multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true babel-polyfill ./ClientApp/boot.browser.ts

我可以找到许多类似问题的帖子,但我真的不知道如何将这些解决方案应用到我的案例中。但它看起来与ContextReplacementPlugin有关。

在我的webpack.config.vendor.js中,我有两行:

new webpack.ContextReplacementPlugin(/\@angular\b.*\b(bundles|linker)/, path.join(__dirname, './ClientApp'))
new webpack.ContextReplacementPlugin(/angular(\\|\/)core(\\|\/)@angular/, path.join(__dirname, './ClientApp'))

任何帮助都将不胜感激!!

0 个答案:

没有答案