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
31 lines (29 loc) · 920 Bytes
/
babel.config.js
File metadata and controls
31 lines (29 loc) · 920 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
31
// @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,
bugfixes: true,
useBuiltIns: 'entry',
corejs: 3,
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
plugins: [
'babel-plugin-lodash',
// Required to support typeorm decorators in ./cmd/precise-code-intel
['@babel/plugin-proposal-decorators', { legacy: true }],
// Node 12 (released 2019 Apr 23) supports these natively, but there seem to be issues when used with TypeScript.
['@babel/plugin-proposal-class-properties', { loose: true }],
],
}
}