-
Notifications
You must be signed in to change notification settings - Fork 259
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
Make it tree-shakable #81
Comments
yes, pako.js is needed only for encoding, not for decoding. You can manually delete the encoding parts from the UPNG.js file. |
Yes, for now I'm using this library with encoding parts deleted. But for everyone(including me) that want to use tree-shaked version, removing implementatinos that are not familiar with doesn't seem right. Since this library doesn't have a lot of functions, it can be easily done. If you are okay with this, may I take over this issue? |
What are your plans? Do you want to make two files? There are certain parts needed both by an encoder and by a decoder. |
No I'm not separating into multiple files. Just going to use This is example of tree-shakable version that I was talking of:
|
My plan is to publish tree-shakable version as v3, and keep current version stay in v2 to prevent you from forcing adopt new toolchains(webpack, npm, etc...). |
I can not use that code, as I want my program to be written in Javascript |
That's not true.
see JavaScript modules and Tree shaking. |
I also think to use I made a fork and changed the module to |
Hey guys! I found this project while testing photopea (also, great work on it @photopea!) About the bundle size, if UPNG is tree-shakeable this will save almost 75% of the bundle size: @photopea please take a look at this: |
@danielbarion I am so confused. The UPNG.js library is 46.6 kB now, and it is 14.5 kB GZipped. If you want it to be small, do not use that tool that you are referring to. |
Similar to this issue
I'm using this library with bundled by Webpack.
In my case, I only use
decode
function. However since this library is wrapped by an object, bundled file includespako
which seems not used when decoding.This results unnecessary large bundle size.
The text was updated successfully, but these errors were encountered: