-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat(package): optimize bundle for package individually #87
feat(package): optimize bundle for package individually #87
Conversation
@floydspace I'd like your input on this - the flow is here but code could - should - probably be optimized. |
@olup thank you very much for the contribution, really appreciate, will check it during the day 👍 |
Actually, I am not too happy with this implementation. It works, but could be better. I think I can skip the copy / install / prune all together by only getting the list of required deps from the packager (from the intersection of externals and actually required dependency in the bundle) - and from there build the zip file by selecting what I allow inside. This would be very neat, I'll update the pr once I find a way to do that. |
@olup to be honest, I tested it and it didn't work for me. I had an issue with copying. Yes please take your time, it would be nice to have the fix. thank you |
af9de83
to
7325a78
Compare
I just hard-pushed the branch with a way better system. |
Hey @olup I tested, it worked perfectly for the case when we need to package externals. |
Ok, I saw the commit. Thank you for fixing the yarn bug ! However on the other thing : the no external case is indeed missing in my code, but I think we need to read the generated package.json, not the original, because it contains only references to the external, and have been generated after some logic already. |
@olup yes go ahead, I agree, this logic should be skipped if we do not use externals |
Just pushed. This makes the external part dependent on if there is externals or not. I also used the declaration of the externals as my comparison array. I wonder if it's ok (I mean, no use of regex and all in this, right ?). This works with my test repo, with and without externals. Also added bundle size in the logs, just because it's nice :-) |
@olup it works perfectly on my test case. Merging it |
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR allows for some optimization on the individual packaging. This is a WIP to get feedback from the main maintainer.