-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
2.0.0-beta.8. 编译RN报错 'babel' of undefined #5093
Comments
CC @luckyadam |
欢迎提交 Issue~ 如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏 如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。 Good luck and happy coding~ |
@zhougonglai 贴一下完整的package.json和configs/index.js吧。 |
package.json "dependencies": {
"@tarojs/components": "2.0.0-beta.8",
"@tarojs/components-qa": "2.0.0-beta.8",
"@tarojs/mobx": "2.0.0-beta.8",
"@tarojs/mobx-h5": "2.0.0-beta.8",
"@tarojs/router": "2.0.0-beta.8",
"@tarojs/taro": "2.0.0-beta.8",
"@tarojs/taro-alipay": "2.0.0-beta.8",
"@tarojs/taro-h5": "2.0.0-beta.8",
"@tarojs/taro-qq": "2.0.0-beta.8",
"@tarojs/taro-quickapp": "2.0.0-beta.8",
"@tarojs/taro-swan": "2.0.0-beta.8",
"@tarojs/taro-tt": "2.0.0-beta.8",
"@tarojs/taro-rn": "2.0.0-beta.8",
"@tarojs/taro-weapp": "2.0.0-beta.8",
"mobx": "4.8.0",
"nerv-devtools": "^1.5.5",
"nervjs": "^1.5.5",
"taro-ui": "^2.2.4"
},
"devDependencies": {
"@types/react": "^16.4.6",
"@types/webpack-env": "^1.13.6",
"@tarojs/mini-runner": "2.0.0-beta.8",
"@tarojs/webpack-runner": "2.0.0-beta.8",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-jsx-stylesheet": "^0.6.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-eslint": "^8.2.3",
"eslint": "^5.16.0",
"eslint-config-taro": "2.0.0-beta.8",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^1.6.1",
"eslint-plugin-import": "^2.12.0",
"stylelint": "9.3.0",
"stylelint-config-taro-rn": "2.0.0-beta.8",
"stylelint-taro-rn": "2.0.0-beta.8",
"eslint-plugin-taro": "2.0.0-beta.8",
"@typescript-eslint/parser": "^1.6.0",
"typescript": "^3.0.1"
} configs/index.js const config = {
projectName: 'konfood',
date: '2019-12-13',
designWidth: 750,
deviceRatio: {
'640': 2.34 / 2,
'750': 1,
'828': 1.81 / 2,
},
sourceRoot: 'src',
outputRoot: 'dist',
babel: {
sourceMap: true,
presets: [
[
'env',
{
modules: false,
},
],
],
plugins: [
'transform-decorators-legacy',
'transform-class-properties',
'transform-object-rest-spread',
],
},
defineConstants: {},
mini: {
postcss: {
autoprefixer: {
enable: true,
config: {
browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'],
},
},
pxtransform: {
enable: true,
config: {},
},
url: {
enable: true,
config: {
limit: 10240, // 设定转换尺寸上限
},
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
},
h5: {
publicPath: '/',
staticDirectory: 'static',
esnextModules: ['taro-ui'],
postcss: {
autoprefixer: {
enable: true,
config: {
browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'],
},
},
cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
},
};
module.exports = function(merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'));
}
return merge({}, config, require('./prod'));
}; |
CC @Pines-Cheng |
问题描述
Taro v2.0.0-beta.8 生产的项目在运行
npm run dev:rn
报错复现步骤
taro init myApp
"@tarojs/taro-rn": "2.0.0-beta.8"
npm i && npm run dev:rn
期望行为
正常运行 RN
报错信息
系统信息
补充信息
The text was updated successfully, but these errors were encountered: