-
Notifications
You must be signed in to change notification settings - Fork 208
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
add .babelrc to .npmignore #270
add .babelrc to .npmignore #270
Conversation
module consumers should be able to transpile this code in whatever way they see fit
Hi @orzechowskid thanks for the PR. The lookup behavior for the Learn more here: |
The PR isn't to remove babel config from the Git repo; it's to remove babel config from the package archive pushed to NPM. I understand that .babelrc is required for development purposes - that's why a change was made to .npmignore instead of .gitignore . When consumers attempt to transpile an app with react-waypoint as an ES2015 module dependency, the babel config at
And that's exactly what's happening to me, because what you refer to as the "current package" is not react-waypoint, it's my app. react-waypoint is complaining that babel-preset-airbnb isn't installed:
...which is true; I don't have that preset installed. That preset, I'm assuming, is needed to build react-waypoint for use in whatever runtimes it supports. No argument there. But It's not needed to transpile react-waypoint code for use on the targets supported by my app. And indeed, removing I hope you'll at least consider re-opening this PR; it's awesome that you're publishing this package with a (and either way, thanks for the good work on this lib - we use it in a bunch of places and it's really come in handy) cheers |
Sorry, I did mistakenly think you had made the commit to
Would making this change potentially impact users who do need it to transpile for all those other targets? I wonder if the real issue might be that we are missing a peerDependency? |
no worries! sorry then for explaining to you a bunch of stuff you probably already knew :) I think that for other projects to successfully transpile node_modules/react-waypoint/es/index.js , they must already be using babel-preset-airbnb and babel-plugin-transform-react-remove-prop-types in their own babel config or else they'd encounter the same error I described above. So they're already set up appropriately, which means there's no impact, and merging this would not be a breaking change requiring a major version bump. What are you thinking about as a peerDependency, and to which package do you see it being applied? I can't see what a peerDependency would do for anyone here that the existing devDependency entries don't. That plugin and preset are correctly listed as devDependencies of react-waypoint since your source is ES2015+ and your output looks like ES5. |
For what it's worth, I agree with adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me. Thanks!
This PR was included in the 8.1.0 release. |
babel applies whatever config is closest to any given source file, meaning a .babelrc provided by this NPM package will overrule a .babelrc belonging to consumers of this package (who may desire or require different presets and plugins for their app).