Closed guoseven closed 3 years ago
@guoseven 使用 corejs3。
Taro 的 babel-preset-taro
对 @babel/preset-env
的参数做了一下封装,你需要做的操作是:
module.exports = {
presets: [
['taro', {
framework: 'react',
ts: false,
useBuiltIns: 'usage'
}]
]
}
npm install core-js@3 --save
、npm install --save @babel/runtime-corejs3
结果:
可以自行阅读 Babel 的 preset-env
和 transform-runtime
文档深究。
相关平台
H5
浏览器版本: Android API23 使用框架: React
复现步骤
run run build:h5
期望结果
页面显示正常
实际结果
白屏
环境信息
补充信息
项目构建完成,搭建简单的页面 I/chromium: [INFO:CONSOLE(2)] "Uncaught TypeError: Object.assign is not a function", source: