-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[CLI] react-native bundle --minify fails with es6 for..of syntax #1499
Comments
This is an issue with uglify-js. Do you mind reporting it there? https://github.com/mishoo/UglifyJS2 Thanks! |
Oh, actually nevermind I'm wrong. We made the switch to babel but we haven't enabled the Now that we are on babel, we'll be able to let you configure which transforms you want to enable per project. This way you can enable more features depending on your risk tolerance to spec and implementation changes. |
Ok good! I'm closing this then. |
Is there a specific reason for I added the transformer in the list in https://github.com/facebook/react-native/blob/master/packager/transformer.js#L21 but it's causing issues when bundling the code (and failing silently when encountering a |
You're also free to enable "es6.forOf" if you want to compile your own JavaScript engine where you know that you're going to have |
Ok, I removed |
Running into this as well with |
Well, that's not only the minify step that fails. JSC doesn't implement |
Thanks for reopening @vjeux! I get it, so Babel isn't transforming |
Beware that if you depend on iOS 9-specific features, people with iOS 6,7,8 will instacrash :) |
@vjeux I had no idea I was depending on iOS 9 features because I assumed the packager was using It would make sense to use the |
@appden RN currently uses Babel 5 and supports the old .babelrc if you want to enable features. So you could enable forOf loops (but as I mentioned earlier in this thread, we can't pull in the runtime to polyfill it on old OSes). |
Apparently there are some issues with this: facebook/react-native#1499
This issue appears to have been answered adequately by suggesting enabling of this feature in .babelrc. |
I tried it on react-native 0.4.4, 0.5.0-rc1 and the latest master.
Works fine with no minification.
The text was updated successfully, but these errors were encountered: