-
Notifications
You must be signed in to change notification settings - Fork 3
/
babel.config.js
38 lines (38 loc) · 1.08 KB
/
babel.config.js
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
var isRunningStorybook = process.env.RUNNING_STORYBOOK === 'true'
var useLooseMode = isRunningStorybook
module.exports = {
presets: [
// Storybook requires loose mode enabled.
// https://github.com/babel/babel/issues/11622#issuecomment-644141879
// Selenium (E2E testing) requires loose mode disabled or will
// error with:
// "TypeError: Cannot assign to read only property 'name' of function "
['@babel/preset-env', { loose: useLooseMode }],
[
'babel-preset-gatsby',
{
targets: {
browsers: ['> 0.5%, last 2 versions, not dead, not IE 11'],
},
},
],
],
plugins: [
// https://github.com/babel/babel/issues/11622#issuecomment-644141879
['@babel/plugin-proposal-class-properties', { loose: useLooseMode }],
['@babel/plugin-proposal-private-methods', { loose: useLooseMode }],
[
'@babel/plugin-proposal-private-property-in-object',
{ loose: useLooseMode },
],
[
'module-resolver',
{
root: ['./'],
alias: {
src: './src/',
},
},
],
],
}