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

Moment-timezone Import Cost #1034

Closed
bsaracalign opened this issue Jan 31, 2023 · 1 comment
Closed

Moment-timezone Import Cost #1034

bsaracalign opened this issue Jan 31, 2023 · 1 comment

Comments

@bsaracalign
Copy link

Moment-timezone version which you use:

Version: "^0.5.40"

Note: many issues are resolved if you just upgrade to the latest version

Issue description:

Import cost for this package is 836.4k (gzipped:59.2k) that's an extremely large size. I understand there may be many reasons and even current development, Is there any place you share for current developments to decrease import cost of this package? Also I do import by import moment from 'moment-timezone' is there a more preferable import that'll help?

@gilmoreorless
Copy link
Member

The overall package size is discussed at #999 — that's the best issue to follow to get updates.

To answer your other question, I've recently added some extra details into the Node.js section of the documentation. Specifically, if you want to avoid the default data file, you can do the following:

import moment from 'moment-timezone/moment-timezone';
moment.tz.load(customData);

The custom data format is described in the Data Loading section, and can be created in a local build step using the filterLinkPack() utility method.

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

No branches or pull requests

2 participants