问题
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