-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
52 lines (52 loc) · 1.49 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
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: "> 0.25%, not dead",
// REVIEW: prevent rollup this undef error?
// targets: {
// esmodules: true,
// },
loose: true,
bugfixes: true,
// don't polyfill while commented out
// useBuiltIns: 'usage', // TODO: currently breaks things in Gatsby projects,
// https://babeljs.io/docs/en/babel-preset-env#forcealltransforms
shippedProposals: true, // https://babeljs.io/docs/en/babel-preset-env#shippedproposals
},
],
// '@babel/preset-typescript',
[
"@babel/preset-react",
{
// https://babeljs.io/docs/en/babel-preset-react/#react-automatic-runtime
// runtime: 'automatic',
useBuiltIns: true,
// cannot use `development` which adds `jsx source` and `jsx self` babel plugins
// due to `undefined` this
// https://github.com/rollup/rollup/pull/3645
},
],
],
plugins: [
// add back missing source from `preset-react`
process.env.ENV_MODE === "local"
? "@babel/plugin-transform-react-jsx-source"
: {},
[
"@quickbaseoss/babel-plugin-styled-components-css-namespace",
{
cssNamespace: "&&&&&&",
},
],
[
"styled-components",
{
pure: process.env.ENV_MODE !== "local",
fileName: process.env.ENV_MODE === "local",
displayName: process.env.ENV_MODE === "local",
},
],
],
}