mapbox / react-colorpickr

A themeable colorpicker with HSL and RGB support for React

Home Page:https://labs.mapbox.com/react-colorpickr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

.babelrc causes issues in other projects

samanpwbb opened this issue · comments

Seeing this error when trying to require the 4.x.x versions of react-colorpickr. My app is using browserify with babelify.

ReferenceError: [BABEL] /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/dist/colorpickr.js: Unknown option: /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/.babelrc.presets while parsing file: /Users/saman/work_repos/maki-icons/node_modules/react-colorpickr/dist/colorpickr.js

https://github.com/mapbox/react-colorpickr/blob/mb-pages/.babelrc

If I add the following:

[
    "babel-preset-es2015": "^6.3.13",
    "babel-preset-react": "^6.3.13",
    "babel-preset-stage-0": "^6.3.13",
]

as devDependencies in my project, the problem goes away, but that shouldn't' be required to use the colorpickr.

We should remove the "browserify" field from package.json - it isn't necessary to transform this module in order to use it.