Re:You Don't Need Moment.js
by ggregoire on Friday September 14, 2018 @05:53PM
(#17991299)
But react-dates has moment as dependency, so…
[ Parent
| on HN ]
Welcome to the wonderful world of code re-use. Hey, at least we're not re-inventing the wheel.
We're reimporting the wheel (which, by the way, also has moment.js as a dependency)
https://github.com/airbnb/react-dates/blob/master/package.js...
A devDependency is not the same as a dependency.
Re:You Don't Need Moment.js
by scottlecrab on Saturday September 15, 2018 @12:24AM
(#17992981)
It's a dev dependency because they use it in unit tests but it's also a peer dependency, meaning that if you want to use the library you need to include moment.