We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
编写跨端代码时,h5里有 import() 语法,编译成微信小程序时,代码报错,内置babel-plugin-dynamic-import-node在小程序端编译时,将import()转换为require,可以增加对import()语法的支持
import()
babel-plugin-dynamic-import-node
可以增加对import()语法的支持
The text was updated successfully, but these errors were encountered:
@superNos 自己加一下咯,情况并没有太普遍,所以还是开发者自行添加吧。
Taro 3 操作 babel.config.js:
// babel-preset-taro 更多选项和默认值: // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md const obj = { presets: [ ['taro', { framework: 'react', ts: true }] ] } if (process.env.TARO_ENV === 'weapp') { obj.plugins = ["dynamic-import-node"] } module.exports = obj
Taro 2 操作 taro 的 babel 配置项。
Sorry, something went wrong.
v3.0.7+ 后内置支持
No branches or pull requests
编写跨端代码时,h5里有
import()
语法,编译成微信小程序时,代码报错,内置babel-plugin-dynamic-import-node
在小程序端编译时,将import()转换为require,可以增加对import()语法的支持
The text was updated successfully, but these errors were encountered: