const isH5 = process.env.TARO_APP_TARGET === 'h5' || process.env.TARO_ENV === 'h5' module.exports = { presets: [ [ 'taro', { framework: 'react', ts: true, // H5 用 Vite;微信/抖音用 webpack5 —— 勿写死 vite,否则 weapp 解析 TS 会挂 ...(isH5 ? { compiler: 'vite' } : {}), }, ], ], }