forked from vuejs/vue-test-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
42 lines (41 loc) · 882 Bytes
/
babel.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const defaultOptions = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
],
'@vue/babel-preset-jsx'
],
plugins: [
'@babel/plugin-syntax-jsx',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-syntax-flow',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }]
],
comments: false
}
module.exports = api => {
if (api.env('browser')) {
// If running in the browser, use core-js to polyfill potentially missing functionality
return {
...defaultOptions,
presets: [
[
'@babel/preset-env',
{
corejs: 3,
useBuiltIns: 'entry'
}
],
'@vue/babel-preset-jsx'
]
}
} else {
return defaultOptions
}
}