【发布时间】:2021-08-18 07:10:37
【问题描述】:
将 webpack 从 4 更新到 5 时,出现错误:
TypeError: message.split is not a function
这是在react-dev-utils/formatWebpackMessages.js中抛出的。
然后我将 react-dev-utils 更新为 @next 版本,以解决此问题。
但是在@next 版本中,react-dev-utils 中没有WatchMissingNodeModulesPlugin 和typescriptFormatter,它们在与webpack4 一起使用的我的webpack.config.js 文件中使用。
我该如何解决这个问题,或者我的 typescript 项目中是否需要这两个工具?
谁能给我一个webpack.config.js 的模板,用于使用 webpack5 的打字稿项目?
【问题讨论】: