今天在学习 TypeScript 中,使用 webpack 打包时报一下错误:

WARNING in configuration
The mode option has not been set, webpack will fallback to production for this value.
Set mode option to development or production to enable defaults for each environment.

上网查了一下资料,解决方案是在 webpack.config.js 配置文件中 添加:mode: 'development'

1
2
3
module.exports = {
mode: 'development'
}