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

Separating Swiper into chunks from entry bundle #29

Merged
merged 2 commits into from
Feb 6, 2023
Merged

Separating Swiper into chunks from entry bundle #29

merged 2 commits into from
Feb 6, 2023

Conversation

misaon
Copy link
Contributor

@misaon misaon commented Jan 23, 2023

Swiper is a relatively large library. When compiling Nuxt, it increases the main entry.js by about 200kb, entry.css by about 100kb. With this modification, swiper will be separated into its own chunk, improving the loading speed of the application.

This is a POC, it is necessary to deal with situations where the developer will set his own rules for manualChunks, because this solution will override.

@cpreston321 cpreston321 self-requested a review January 23, 2023 14:59
src/module.ts Outdated Show resolved Hide resolved
src/module.ts Outdated Show resolved Hide resolved
@cpreston321
Copy link
Owner

Hey @misaon! I just want to say I appreciate your PR! 💚

I had a few comments and suggestions. if you have any questions let me know!

Thanks 🙏

Swiper is a relatively large library. When compiling Nuxt, it increases the main entry.js by about 200kb, entry.css by about 100kb. With this modification, swiper will be separated into its own chunk, improving the loading speed of the application.
@misaon
Copy link
Contributor Author

misaon commented Jan 24, 2023

@cpreston321 is that okay?

Copy link
Owner

@cpreston321 cpreston321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpreston321 cpreston321 merged commit 9719628 into cpreston321:main Feb 6, 2023
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

Successfully merging this pull request may close these issues.

2 participants