-
-
Notifications
You must be signed in to change notification settings - Fork 58
Big bundle size due to core-js #33
Comments
That makes sense, I'll be updating the menu later and this dependency will be removed in favor of local polyfills. |
To be honest, I'm really not worried about a 36 KB size. |
@rawilk why i def appreciate you releasing this library, that's 36KB gzip minified (which not everything supports gzip) -- so minified is around 101kb in size: While I understand you may not be worried about it, there may be others who do (just wanted to mention that). For those that do, my recommendation would be to use webpack chunking/code-splitting to only load it when needed (async): Unfortunately because this lib does not just export components: {
VueContext: async () => {
const instance = await import( /* webpackChunkName: "vue-context" */ 'vue-context' )
return instance.VueContext
}
}, When any other lib that exports as default, could just be like this: SomeLibComponent: () => import( /* webpackChunkName: "some-lib-component" */ 'some-lib-component' ), If you're not familiar with code splitting yet, i strongly recommend reading and learning more about it, as this will allow you to keep bundle size small and async load resources as they are needed (to not cause delay on initial page load) Now that 4.1+ doesn't include the CSS i'm going to have to figure out how to deal with this as well :-\ Good resource: |
I'm still trying to figure out why the dist version of this lib is 100kb+, but when i build it from source, it's only around ~17kb ... so i would say if anything, import the source into your own project if you have all the webpack handling setup -- my guess is there's a lot of bloat in the released dist version |
@tripflex Good point. I think I'm not going to build it anymore and leave that part of it to you instead. I think that should help sizes. |
Using
vue-context
increases bundle size by 41 KB (gzipped). It seems tree-shaking is not working properly, and the wholecore-js
in bundled in, not just the two functions used.The text was updated successfully, but these errors were encountered: