-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.babelrc
67 lines (59 loc) · 1.53 KB
/
.babelrc
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
62
63
64
65
66
67
// Plugins run before Presets.
// Plugin ordering is first to last.
// Preset ordering is reversed (last to first).
{
"plugins": [
"object-styles-to-template",
["chronstruct-primitives", {
"autoImport": true
}],
// able to use `class` instead of `className` and `for` instead of `htmlFor`
"react-html-attrs",
// handle decorators
"transform-decorators-legacy"
// handle do expressions (currently stage-0)
/* "transform-do-expressions", */
],
"presets": [
["es2015",
{
// enable _native_ modules for tree shaking
"modules": false,
"loose": true
}
],
"react",
// class properties and beyond
"stage-2"
],
"env": {
"development": {
"plugins": [
// needed for hot loader
"react-hot-loader/babel",
// adds file and line # to components
// helpful for error stack traces
"transform-react-jsx-source",
],
"presets": [
"linaria/babel"
]
},
"production": {
"plugins": [
// Hoists element creation to the top level for subtrees that are fully static
"transform-react-constant-elements",
// replaces react.createElement with inline if no ref or obj spread
// NOTE: currently does not work with chronstruct-primitives
// "transform-react-inline-elements",
],
"presets": [
["linaria/babel", {
"single": true,
"filename": "styles.css",
"outDir": "public"
}]
]
}
}
}