Webpack - 获得强烈警告,如何解决?

时间:2018-02-02 09:25:04

标签: angular webpack

我创建了自己的webpack angular。我在构建时遇到以下错误:

WARNING in ./node_modules/@angular/core/esm5/core.js
6541:15-36 Critical dependency: the request of a dependency is an expression
 @ ./node_modules/@angular/core/esm5/core.js
 @ ./node_modules/@angular/platform-browser-dynamic/esm5/platform-browser-dynamic.js
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://localhost:9000 ./src/main.ts

如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

似乎是一个在更新版本中修复的常见问题。根据此Github issue,请停止显示以下内容:

new webpack.ContextReplacementPlugin(
  /\@angular(\\|\/)core(\\|\/)esm5/,
  path.resolve(__dirname, "./src")
),