-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Reduce minimalistic bundles size #388
Comments
The main problems here: it's maximally strict, it should work everywhere and it contains common export logic. Because it should work everywhere, it should internally implement all of the required logic. The serious part of this logic - ES5 polyfills required for IE8-, for example, Here 3 options how to rework
|
Thanks for the explanation. What about adding a require ( 'core-js-builder' )({
modules: ['es6.array.fill'],
targets: {
browsers: ['last 2 versions']
}
}); the builder can automatically avoid to bundle those polyfills for legacy browsers? |
Sounds good, but it's too hard. Anyway, need to think about it. |
I've tried to blacklist blacklist: ['es6.object.define-property'] but it didn't work, I guess because some other polyfill I'm compiling requires this. It would be nice if we could enforce this setting, in that case those polyfills that depend on this would just assume it's already available. |
@fabiospampinato it will not work this way. Fundamental features implemented internally and entry points like |
@zloirock Wouldn't be better separating modules in individual, installable packages such as |
@thiagodp it's absolutely not related to this issue and can't help here - for example, |
@zloirock The idea adheres to the 3rd option:
The involved refactoring would do the job. Separating into individual modules is a way to refactoring them and to pruning unneeded dependencies. Also, people could choose between using specific modules or all of them (i.e., a unified module). I know that's hard to do now, but the project could benefit from it more than just refactoring the code. |
Sorry, but not in this case. Rather here will be a backward effect - I made many experiments with it. It will be almost a thousand packages - modules and some thousands of packages - entries for different cases. Who will add hundreds of polyfill packages to So it will increase not only the bundle size for all users - it will increase the Maybe I'll do it in the future, but for other reasons and not soon. |
@zloirock Totally agree. I did not know much about the project's specifics. Thanks for sharing. |
@thiagodp if you are wondering what this problem looks with the separate packages approach, see es-shims/AggregateError#13 |
I've made a custom build with the following code:
And the resulting build is 5.5kb, that seems excessively large to me.
Isn't there a way to make it smaller?
I would be surprised if a minified polyfill for this required more than 0.2kb, core-js' file is about 30 times larger than that.
The text was updated successfully, but these errors were encountered: