You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Parcel 2.0中使用tree shaking是否需要指定实验性scope hoisting标识

Parcel 2.0 tree shaking使用说明

  • Parcel 2.0 中 tree shaking功能已经脱离实验阶段,不再需要指定--experimental-scope-hoisting标识。该参数是Parcel 1.x版本的专属实验参数,仅在1.x版本中需要通过该参数开启scope hoisting能力以支持tree shaking。
  • 2.0及以上版本直接执行默认生产构建命令即可自动启用tree shaking:
parcel build entry.js
  • 额外提示:tree shaking仅对使用import/export语法的ESM模块生效,使用CommonJS规范的require引入的模块默认无法触发tree shaking逻辑。

内容的提问来源于stack exchange,提问作者Mateo Lara

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 04:15:01