fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.36k stars 437 forks source link

Use a .babelrc instead of a babel config in the package json #348

Open jordmur opened 6 years ago

jordmur commented 6 years ago

This issue seems to be happening on windows machines (for developers) using NPM 5.6.0. In the package once it is installed, the properties are alphabetized such that

"babel": {
    "presets": [
      "es2015",
      "react"
    ],
    "plugins": [
      "transform-object-assign"
    ]
  },

is higher up than the dependencies, and npm seems to hit this and find that we don't have "transform-object-assign" installed.

We are currently using babel-polyfill. If we install transform-object-assign as a dev-dependency in our repo, this resolves the issue. However, this seems an unnecessary resolution, as we don't need it as a dependency since we have babel-polyfill.

I believe this would all be resolved using a .babelrc so that the config isn't in the package and npm won't hit it. (Admittedly, this is probably a bit of an npm 5.6.0/windows issue rather than a react-scroll issue). If others agree, I can submit a PR with this change. I see others have gotten this error as well: https://github.com/fisshy/react-scroll/issues/238#issuecomment-352769258