作者:
tume209 (tume209)
2019-11-16 15:00:19各位大大好,最近在學習babel設定時,官方說明處理順序會先使用plugin再使用preset,假設設定為下(大概示意)
presets :
[ "@babel/env" , { useBuiltInt : false } ]
plugins :
[ "@babel/plugin-transform-runtime" ]
此時要babel的代碼內有class語法,則env會生成的helper函數,而transform-runtime會接著將helper替換為引入runtime庫內的檔案。
但這樣babel處理順序不就變成
先preset → env生成helper
再plugin → 將helper移除,改成引入
這裡是不是怪怪的阿?