-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.babelrc.js
More file actions
27 lines (26 loc) · 751 Bytes
/
Copy path.babelrc.js
File metadata and controls
27 lines (26 loc) · 751 Bytes
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
module.exports = api => {
api.cache.using(() => {
// cache based on the two env vars
return 'babel:' + process.env.BABEL_TARGET +
' protractor:' + process.env.IN_PROTRACTOR;
});
return {
"plugins": [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }]
],
"presets": [
[
"@babel/preset-env", {
"targets": process.env.BABEL_TARGET === 'node' ? {
"node": process.env.IN_PROTRACTOR ? '6' : 'current'
} : {
"browsers": [ "last 2 versions" ]
},
"loose": true,
"modules": process.env.BABEL_TARGET === 'node' ? 'commonjs' : false
}
]
]
}
}