Skip to content

moment shouldn't be a dependency #60

@ruffle1986

Description

@ruffle1986

Hi,

Before I start, let me thank you for pikaday-time. It's a great library and it saved us a lot of time. So thank you for your hard work and making it happen. 🍻

I know you no longer maintain this repo but I'm still hoping that we can solve my problem somehow.

I've noticed that moment.js is just an optional dependency of the original Pikaday lib and I'm not sure if that's the case with your fork. I've noticed you marked moment as an optionalDependency in your package.json so the answer is yes I guess.

We use pikaday-time in our application and npm installs moment every time because it's a dependency of your lib.
We're building an angular app and we try to get rid of moment.js and switch to another date/time manipulation library which has a smaller footprint in the final bundle (e.g date-fns). But since moment.js is a dependency hence npm installs it every time and Pikaday has a dynamic module loading strategy, moment will be part of the final bundle however we have eliminated everywhere in our source code.

I think if we set moment as a peerDependency that would solve my problem.

I'd be more than happy to open a PR with this patch if you helped me with the release.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions