-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbabel.config.cjs
More file actions
45 lines (44 loc) · 1.32 KB
/
Copy pathbabel.config.cjs
File metadata and controls
45 lines (44 loc) · 1.32 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Babel configuration shared across the repo.
*/
require('dotenv').config();
/**
* @type {import('@babel/core').TransformOptions}
*/
module.exports = {
babelrc: false,
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
plugins: [
'@babel/plugin-transform-class-properties',
'@babel/plugin-transform-object-rest-spread',
'@babel/plugin-transform-runtime',
// import.meta parsing is native to Babel's parser since 7.8 and has
// no @babel/plugin-syntax-import-meta release for Babel 8; the
// plugin was a no-op even before removal.
],
env: {
// Jest runs modules as CommonJS; rewrite import.meta.url so ESM
// sources that use it can load (#3472).
test: {
plugins: ['./scripts/babel/transform-import-meta-url.cjs'],
},
},
ignore: process.env.BABEL_IGNORE
? process.env.BABEL_IGNORE.split(',')
: [
'build',
'dist',
'coverage',
'test-results',
'vendor',
'.next',
'logs',
'tmp',
'.cache',
'.husky',
'.vercel',
'.netlify',
'.storybook',
'docs/mustache-repo-templates',
],
};