Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use moment-timezone with moment without locales or moment-mini #786

Open
F0b0s opened this issue Oct 8, 2019 · 4 comments
Open

Comments

@F0b0s
Copy link

F0b0s commented Oct 8, 2019

Hello, are there any possibility to use moment-timezone with moment without locales(or maybe with subset of locales) or moment-mini? I would like to reduce bundle size.

@parth391
Copy link

parth391 commented May 4, 2022

@Frost, Did you find any solution?

@F0b0s
Copy link
Author

F0b0s commented May 4, 2022

no :(

@ichernev
Copy link
Contributor

@F0b0s well, I've been thinking of making moment-timezone a proper plugin that gets passed a moment instance, that would probably work with tiny moment (of course if moment-timezone uses locale API it won't), but you get the idea.

You can fork the repo and tweak it slightly so moment-timezone "adds" .tz only for a passed in moment and not from imported moment, and give it a go, then report your findings.

@ichernev
Copy link
Contributor

To be fair importing moment shouldn't import any locales, maybe if you're using some fancy package manager that is dumb and puts locales in anyway, you can just instruct it not to...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants