perf: Remove unused es6.number.constructor polyfill #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I was doing a POC for Vue components built with
--target lib
and Vue CLI, but instead of using webpack it's using Rollup. Generally speaking, using Rollup as a module bundler will result in a smaller bundle size, but you can get the most out of the default Vue CLI build system by just using a better@babel/preset-env
config, tuned for bundling components as a library.Before:
After (using
useBuiltIns: false
):Explanation
Per the
@vue/babel-preset-app
docs:In your specific case
es6.number.constructor
polyfill is being added, because bothLaravelVuePagination.vue
andRenderlessLaravelVuePagination.vue
have a prop validator with theNumber
constructor. Babel is working on the safe side and includes 8.81 KiB of polyfills for the whole browser compat table here. In reality, non of those are needed for the Vue validators to correctly work in the supported browsers in.browserslistrc
config.tl;dr: 40.4% size reduction with no additional cost 🎉