This repository has been archived by the owner on Dec 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
babel.config.js
61 lines (59 loc) · 1.65 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* eslint-disable no-template-curly-in-string */
module.exports = function (api) {
api.cache(true)
return {
presets: ['@babel/preset-env', ['@babel/preset-react', {runtime: 'automatic'}]],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-transform-runtime',
'@babel/plugin-syntax-dynamic-import',
[
'transform-imports',
{
'tocco-app-extensions': {
transform: 'tocco-app-extensions/src/${member}',
preventFullImport: true
},
'tocco-util/?(((\\w*)?/?)*)': {
transform: 'tocco-util/src/${1}/${member}',
preventFullImport: false
},
'tocco-test-util': {
transform: 'tocco-test-util/src/${member}',
preventFullImport: true
},
'tocco-theme': {
transform: 'tocco-theme/src/${member}',
preventFullImport: true
},
'redux-form': {
transform: 'redux-form/es/${member}',
preventFullImport: true
}
}
],
[
'babel-plugin-styled-components',
{
displayName: true,
fileName: false,
namespace: 'Tocco',
ssr: false,
transpileTemplateLiterals: false,
minify: false
}
],
'lodash'
],
env: {
test: {
plugins: ['dynamic-import-node']
},
production: {
plugins: ['transform-react-remove-prop-types', '@babel/transform-react-constant-elements']
}
}
}
}