Umi: [Bug] 开发模式保留 console,生产模式才去除 console,应该怎么做?

Created on 31 Dec 2020  ·  4Comments  ·  Source: umijs/umi

What happens?

最小可复现仓库

请使用 yarn create @umijs/umi-app 创建,并上传到你的 GitHub 仓库


复现步骤,错误日志以及相关配置


相关环境信息

  • Umi 版本
  • Node 版本
  • 操作系统
type(bug)

Most helpful comment

有一种方法是配置 terser 在压缩时去除 console:
```js
terserOptions: {
compress: {
drop_console: true
}
}

All 4 comments

有一种方法是配置 terser 在压缩时去除 console:
```js
terserOptions: {
compress: {
drop_console: true
}
}

有一种方法是配置 terser 在压缩时去除 console:

terserOptions: {
  compress: {
    drop_console: true
  }
}

不知道为啥,我配置了没生效。。

在哪里配置的

.umirc.ts的config里面配置的

Was this page helpful?
0 / 5 - 0 ratings