You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the options, select Babel, and select to put configuration into its own files
Enter the project and run npm run build
Remember the size of the file output
Change the value of the .browserslistrc file to Chrome > 70 (should have almost no polyfills)
Run npm run build again
What is expected?
The bundle sizes should change when the browserslist has been changed to reflect the additional polyfills being brought in.
What is actually happening?
Nothing. The .browserslistrc file has no effect on the output size of the files
It appears that the preset-env plugin only takes a browserslist into account if it is present in the package.json. If the same steps are taken in the package.json file then the chunk-vendors file goes from 82KB to 65KB.
This was noted in #1236 when browserslist file generation was added, though it appears that the underlying issue was not resolved.
LinusBorg
changed the title
@vue/babel-preset-env does not respect the .browserslistrc file
Changing .browserslistrc file content doesn't invalidate cache
Mar 13, 2019
Version
3.5.1
Reproduction link
https://github.com/steveworkman/browserslisttest
Environment info
Steps to reproduce
vue create project
npm run build
.browserslistrc
file toChrome > 70
(should have almost no polyfills)npm run build
againWhat is expected?
The bundle sizes should change when the browserslist has been changed to reflect the additional polyfills being brought in.
What is actually happening?
Nothing. The
.browserslistrc
file has no effect on the output size of the filesIt appears that the preset-env plugin only takes a browserslist into account if it is present in the package.json. If the same steps are taken in the
package.json
file then the chunk-vendors file goes from 82KB to 65KB.This was noted in #1236 when browserslist file generation was added, though it appears that the underlying issue was not resolved.
The offending code appears to be in https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/babel-preset-app/index.js#L90 where the targets come from the options of the plugin in this scenario, which the readme says comes from
package.json
https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app#targetsThe text was updated successfully, but these errors were encountered: