forked from project-chip/zap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.js
More file actions
28 lines (25 loc) · 784 Bytes
/
babel.config.js
File metadata and controls
28 lines (25 loc) · 784 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
28
/* eslint-disable */
module.exports = (api) => {
const envOptions = {}
// Options scaffolded by Quasar out of the box
if (api.caller((caller) => caller && caller.target === 'node')) {
envOptions.targets = { node: 'current' }
}
// Only used in test environment in JS codebases
if (api.env() === 'test') {
envOptions.modules = 'commonjs'
envOptions.targets = { node: 'current' }
}
return {
presets: [
['@quasar/babel-preset-app', envOptions],
'@babel/preset-typescript'
],
plugins: [
// Add Istanbul plugin for code coverage instrumentation when testing
process.env.NODE_ENV === 'test' && 'istanbul',
// Add coverage plugin for Cypress
process.env.CYPRESS_COVERAGE && 'istanbul'
].filter(Boolean)
}
}