-
Notifications
You must be signed in to change notification settings - Fork 28
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
Weird bundle size in production #14
Comments
Update: |
@sergio-bravo Do you have an example how to get this working with webpack and date-fns-timezone? |
Any updates ? |
Webpack config resolve: {
extensions: ['*', '.js', '.jsx'],
alias: {
'timezone-support$': path.join(__dirname, 'node_modules/timezone-support/dist/index-2012-2022.js')
}
} |
@Pagebakers sorry I only saw the question now. I used webpack tree-shaking guide, not alias As I can remember it was done in
and `package.json``
|
No worries :) Thanks, this is what I tried at first but it always seemed to include the full timezone database. |
I'm having the same issue as the OP. Using this library via date-fns-timezone and getting nearly 1 MB of timezone-support in my production build. I'm building via next.js. Anyone find a fix for this yet? |
I'm seeing the same picture and not sure if any of the above mentioned solutions works to bring down the final bundle size? I am using webpack through |
My suggested webpack config works perfect for me. You could even copy the index-2012-2022.js list and strip out even more relevant data to decrease the size. |
It's just that my webpack config is completely vanilla, I have not had the need to do any custom configurations at all to all my packages as they all allow tree shaking — maybe a few do not, but they are so small that the gain would be negligible. This package should do this out of the box really — especially due to its large size. I'll try it out, thanks! |
Hi.
In readme it's said:
In my project I see different picture:
I use it via date-fns-timezone: ^0.1.4
The text was updated successfully, but these errors were encountered: