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

Shrink Package Install Size #9

Open
suphero opened this issue Oct 30, 2023 · 0 comments
Open

Shrink Package Install Size #9

suphero opened this issue Oct 30, 2023 · 0 comments
Labels
optimization Improvements in efficiency, performance, or size of the codebase or component.

Comments

@suphero
Copy link
Member

suphero commented Oct 30, 2023

Feature Proposal

Introduce mechanisms or optimizations to reduce the size of the npm package.

Description of the Problem

Many users, especially those with limited bandwidth or storage, face challenges when trying to install or update large npm packages. A bloated package size can also lead to longer deployment times and increased costs for some cloud providers. The objective is to make our npm package more lightweight without sacrificing core functionality, ensuring a faster and more efficient experience for our users.

Proposed Solution

  • Tree shaking: Implement tree shaking to ensure that only the necessary parts of the code are included in the final bundle.
  • Minify Source Code: Utilize tools like Terser to minify the source code which can significantly reduce the package size.
  • Remove Unused Dependencies: Conduct a thorough review of package.json and remove any dependencies that aren't crucial to the package's core functionality.
  • Optimize Media Assets: If the package contains images or other media assets, consider compressing them or moving them to external hosting and linking to them instead.
  • Use .npmignore: Ensure that only essential files (like dist, source files, README, etc.) are included in the npm package by optimizing the .npmignore file.

Alternatives

  • External CDN: Instead of packaging everything, consider hosting larger files or assets on an external CDN and linking to them from within the npm package. This reduces the initial package size but may introduce external dependencies.
  • Multiple Packages: Break the package into smaller modules or packages, allowing users to install only what they need. However, this might complicate the setup for some users.

Additional Information

Reducing the npm package size can not only provide a better user experience but can also lead to cost savings, especially when considering the cumulative bandwidth over thousands or millions of downloads. This initiative can be an essential step toward making our tool more accessible and efficient for all users.

@suphero suphero added the optimization Improvements in efficiency, performance, or size of the codebase or component. label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Improvements in efficiency, performance, or size of the codebase or component.
Projects
None yet
Development

No branches or pull requests

1 participant