forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.js
More file actions
30 lines (27 loc) · 762 Bytes
/
babel.config.js
File metadata and controls
30 lines (27 loc) · 762 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
29
30
// @ts-check
/** @type {import('@babel/core').ConfigFunction} */
module.exports = api => {
const isTest = api.env('test')
api.cache.forever()
return {
presets: [
[
'@babel/preset-env',
{
// Node (used for testing) doesn't support modules, so compile to CommonJS for testing.
modules: isTest ? 'commonjs' : false,
useBuiltIns: 'entry',
corejs: 3,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
'babel-plugin-lodash',
// Node 12 (released 2019 Apr 23) supports these natively, so we can remove this plugin soon.
'@babel/plugin-proposal-class-properties',
],
}
}