Skip to content
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

Remove .babelrc from the published package (for using with React Native) #17

Closed
wants to merge 1 commit into from

Conversation

fson
Copy link

@fson fson commented Nov 3, 2016

Installed from npm, this package doesn't work with React Native, because although the released code is transpiled, .babelrc is also published to npm.

Fixed by adding the files property in package.json to prevent .babelrc from being published.

See:
facebook/react-native#4062

Installed from npm, this package doesn't work with React Native,
because although the released code is transpiled, .baberc is
also published to npm.

Fixed by adding the `files` property in package.json to prevent .babelrc from being published.

See:
facebook/react-native#4062
@ForbesLindesay
Copy link
Owner

See #16

@fson
Copy link
Author

fson commented Nov 3, 2016

I understand why Babel should not be applied to node_modules, but in this case I can't do anything about the current behavior of the React Native packager.

I wish you would consider taking this patch as a practical workaround to avoid everyone using redux-optimist with React Native having to publish their own fork to npm. The package published to npm doesn't include the src folder, so I'm quite certain .babelrc doesn't have a practical reason to be published there.

@ForbesLindesay
Copy link
Owner

You could contribute a patch to fix the bug in react-native. Alternatively you can rm node_modules/redux-optimist/.babelrc as a postinstall step. I don't want to take this as there are other reasons running babel against node_modules will break things and merging this encourages people to think it's a good idea to do so. I also don't want to have to make the same change to all my other packages or leave all the other module authors in the position of having to do the same thing. If I (and every other package author) merge changes like this, there is no pressure on react-native to fix their bug.

@fson
Copy link
Author

fson commented Nov 3, 2016

That makes sense. Thanks for taking the time to explain this decision 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants