2020-12-04 19:40:17 +08:00
|
|
|
// the file is used for jest testing & site building
|
2020-12-16 10:57:40 +08:00
|
|
|
// > 2%, make template string not compiled to concat, since it's not fast
|
2019-06-03 23:42:44 +08:00
|
|
|
module.exports = {
|
2021-02-17 14:55:44 +08:00
|
|
|
presets:
|
|
|
|
process.env.NODE_ENV === 'test'
|
|
|
|
? [
|
2021-05-17 13:42:55 +08:00
|
|
|
['@babel/preset-env', { targets: { node: 'current' } }],
|
|
|
|
[
|
|
|
|
'@babel/preset-typescript',
|
|
|
|
{
|
|
|
|
allExtensions: true,
|
|
|
|
isTSX: true,
|
|
|
|
jsxPragma: 'h',
|
|
|
|
jsxPragmaFrag: 'Fragment'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'@babel/preset-react',
|
|
|
|
{
|
|
|
|
pragma: 'h',
|
|
|
|
pragmaFrag: 'Fragment'
|
|
|
|
}
|
|
|
|
]
|
2021-02-17 14:55:44 +08:00
|
|
|
]
|
|
|
|
: [
|
2021-05-17 13:42:55 +08:00
|
|
|
[
|
|
|
|
'@babel/preset-env',
|
|
|
|
{
|
|
|
|
targets: '>2%, not IE 11'
|
|
|
|
}
|
|
|
|
]
|
2021-02-17 14:55:44 +08:00
|
|
|
]
|
2019-06-03 23:42:44 +08:00
|
|
|
}
|