React Native捆绑:SyntaxError:意外的令牌:运算符(*)

时间:2017-01-27 22:00:57

标签: ios react-native uglifyjs react-native-ios

当我尝试将我的应用捆绑在一起时:

react-native bundle --platform ios --dev false \
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle

我收到以下错误,没有其他详细信息:

SyntaxError: Unexpected token: operator (*)

对于它的价值,这可行(使用--dev true):

react-native bundle --platform ios --dev true \
    --entry-file index.ios.js --bundle-output iOS/main.jsbundle

我最好的猜测是问题出现在UglifyJS的某个步骤中,可能与以下内容有关:

https://github.com/mishoo/UglifyJS2/issues/1199

任何提示?欢迎提出更深入挖掘的建议!谢谢!

1 个答案:

答案 0 :(得分:5)

我们找到了行号:

./node_modules/.bin/esvalidate --formatter=sublime.js ios/main.jsbundle

问题是使用** ES6运算符。恢复为Math.pow()

相关问题