hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Library depends on date-fns #457

Open dmkav opened 3 years ago

dmkav commented 3 years ago

Subject of the issue

Production bundle includes date-fns for react-date-range

[BUG] Bug Reproduce Steps

Install react-date-range version 1.1.3, try to build project. It will ask to install date-dns. Install it as dev dep. After install and rebuild webpack bundle anylizer shows date-dns included into bundle. image

[BUG] Expected behaviour

Do not include date-fns into bundle

Environment

Package Version: 1.1.3 React version: 16.8 Node version: 14.15.4 Browser: Chrome

keremciu commented 3 years ago

hello @dmkav is there a specific reason you tried to install it as a dev dependency? it's used inside the code why it's needed in the bundle

dmkav commented 3 years ago

hi, @keremciu, thank you for support. That's strange, but webpack can't build project it shows error that react-date-picker requires date-fns

kamyar commented 3 years ago

Does the recent version solve this? We recently published this PR that seems to address this, please let us know if it does not:

429