New issue
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
[Taro 3.0.0-rc.3] babel preset targets 配置无效 #6547
Comments
@charmtiger 进入 node_modules/babel-preset-taro/index.js 打印一下 target 调试一下? |
@Chen-jj 尝试在最下方打印 console.log('[presets] ', presets[0][1]);
return {
sourceType: 'unambiguous',
overrides: [{
exclude: [/@babel[/|\\\\]runtime/, /core-js/],
presets,
plugins
}]
} 结果如下 [presets] {
spec: undefined,
loose: false,
debug: false,
modules: false,
targets: { chrome: '42' },
useBuiltIns: false,
ignoreBrowserslistConfig: false,
configPath: undefined,
include: undefined,
exclude: undefined,
shippedProposals: undefined,
forceAllTransforms: undefined
} |
This was referenced Jun 8, 2020
@yuche 升级到 rc.5 如此配置仍然不可运行,如下图所示 报错 module.exports = {
sourceMap: false,
presets: [
['taro', {
framework: 'react',
ts: true,
targets: {
ios: '7',
android: '4',
// chrome: '44'
}
}]
]
} Taro CLI 3.0.0-alpha.7 environment info:
System:
OS: macOS 10.15.4
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.4 - ~/.config/yarn/global/node_modules/.bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
@tarojs/cli: 3.0.0-rc.5 => 3.0.0-rc.5
@tarojs/components: 3.0.0-rc.5 => 3.0.0-rc.5
@tarojs/taro: 3.0.0-rc.5 => 3.0.0-rc.5
@tarojs/webpack-runner: 3.0.0-rc.5 => 3.0.0-rc.5
eslint-config-taro: 3.0.0-rc.5 => 3.0.0-rc.5
nerv-devtools: ^1.5.6 => 1.5.7
nervjs: ^1.5.6 => 1.5.7
react: ^16.10.0 => 16.13.1 npm run build:h5 产出的代码 只有 app.xxx.js 中包含 const 、Object.assign |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题描述
h5 在chrome 42 中空白,console 中显示 Uncaught SyntaxError: Unexpected token )
npm run build:h5 代码中仍有 const , () => {}。
复现步骤
babel.config.js
系统信息
Taro CLI 3.0.0-alpha.7 environment info:
System:
OS: macOS 10.15.4
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.4 - ~/.config/yarn/global/node_modules/.bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
npmPackages:
@tarojs/cli: 3.0.0-rc.3 => 3.0.0-rc.3
@tarojs/components: 3.0.0-rc.3 => 3.0.0-rc.3
@tarojs/taro: 3.0.0-rc.3 => 3.0.0-rc.3
@tarojs/webpack-runner: 3.0.0-rc.3 => 3.0.0-rc.3
eslint-config-taro: 3.0.0-rc.3 => 3.0.0-rc.3
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
react: ^16.10.0 => 16.13.1
The text was updated successfully, but these errors were encountered: