Convince Webpack to explain its `Can't resolve 'foo'` error

蓝咒 提交于 2019-12-11 06:22:40

问题


How can I convince Webpack to, when it is going to emit Can't resolve 'foo', also emit information about where it tried to find that library?

The error message Can't resolve 'foo' is unhelpful because it is a dead end. The reader has no clue which paths Webpack tried and failed; so there's no information to distinguish:

  • The file is in a known location, Webpack found it there, but for some reason didn't use it.

    (Implies the need for diagnostic information about why it didn't use it.)

  • The file is in a known location, but Webpack did not look there.

    (Implies the need for diagnostic information about what locations Webpack tried.)

  • The file is not actually where the programmer thinks it is.

    (Implies the need for diagnostic information about what locations Webpack tried.)

  • Something else.

How can I convince the Webpack program to actually give diagnostic information along with the Can't resolve 'foo' error, to help quickly troubleshoot and distinguish between the above conditions?

来源:https://stackoverflow.com/questions/50884584/convince-webpack-to-explain-its-cant-resolve-foo-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!