File tree 1 file changed +24
-5
lines changed
packages/@vue/babel-preset-app
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 = {}) => {
48
48
decoratorsLegacy
49
49
} = options
50
50
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
+ }
56
75
57
76
// included-by-default polyfills. These are common polyfills that 3rd party
58
77
// 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