File tree Expand file tree Collapse file tree 1 file changed +24
-5
lines changed
packages/@vue/babel-preset-app Expand file tree Collapse file tree 1 file changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,30 @@ module.exports = (context, options = {}) => {
4848 decoratorsLegacy
4949 } = options
5050
51- const targets = process . env . VUE_CLI_BABEL_TARGET_NODE
52- ? { node : 'current' }
53- : process . env . VUE_CLI_MODERN_BUILD
54- ? { esmodules : true }
55- : rawTargets
51+ // resolve targets
52+ let targets
53+ if ( process . env . VUE_CLI_BABEL_TARGET_NODE ) {
54+ // running tests in Node.js
55+ targets = { node : 'current' }
56+ } else if ( process . env . VUE_CLI_BUILD_TARGET === 'wc' || process . env . VUE_CLI_BUILD_TARGET === 'wc-async' ) {
57+ // targeting browsers that at least support ES2015 classes
58+ // https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugins.json#L52-L61
59+ targets = {
60+ browsers : [
61+ 'Chrome >= 49' ,
62+ 'Firefox >= 45' ,
63+ 'Safari >= 10' ,
64+ 'Edge >= 13' ,
65+ 'iOS >= 10' ,
66+ 'Electron >= 0.36'
67+ ]
68+ }
69+ } else if ( process . env . VUE_CLI_MODERN_BUILD ) {
70+ // targeting browsers that support <script type="module">
71+ targets = { esmodules : true }
72+ } else {
73+ targets = rawTargets
74+ }
5675
5776 // included-by-default polyfills. These are common polyfills that 3rd party
5877 // dependencies may rely on (e.g. Vuex relies on Promise), but since with
You can’t perform that action at this time.
0 commit comments