babel-preset-vue-app
babel-preset-vue-app copied to clipboard
Support browserslist
babel-preset-env internally uses browserslist to get the actual browser versions.
But currently in babel-preset-vue-app we use { ie: 9, uglify: true } as default targets value.
So, should we consider supporting browserslist?
After tweaking some code for a while I came up with this idea.
babel-preset-env has this option: ignoreBrowserslistConfig.
So, we can make use of it: when it is specified (default) we can fallback to { ie: 9, uglify: true }.
But, when it is set to false - then we just pass undefined to the options here: https://github.com/vuejs/babel-preset-vue-app/blob/master/src/index.js#L21
Something like this:
[require('babel-preset-env').default, {
useBuiltIns,
targets: ignoreBrowserslistConfig ? targets : undefined,
modules: false
}],
@egoist what do you think? I can create a PR if that's fine.