Taro terser

2021-09-23 21:04 更新

terser

object

配置 terser 工具以壓縮 JS 代碼。

terser.enable

boolean

默認(rèn)值 true

是否開啟 JS 代碼壓縮。

terser.config

object

terser 的具體配置。

  1. module.exports = {
  2. // ...
  3. terser: {
  4. enable: true,
  5. config: {
  6. // 配置項(xiàng)同 https://github.com/terser/terser#minify-options
  7. }
  8. }
  9. }

terser 配置只在生產(chǎn)模式下生效。如果你正在使用 watch 模式,又希望啟用 terser,那么則需要設(shè)置 process.env.NODE_ENV'production'。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)