-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.js
46 lines (42 loc) · 991 Bytes
/
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
const plugins = [];
// We need babel for code instrumentation
const enableCoverage = process.env.COVERAGE && process.env.COVERAGE !== "false";
if (enableCoverage) {
const debug = require("debug")("coverage");
debug("Enabling istanbul plugin in babel"); // eslint-disable-line no-console
plugins.push("istanbul");
}
// Add support of styled components
plugins.push([
"styled-components",
{
ssr: true,
displayName: true,
preprocess: false,
},
]);
// // Fixe for pragmaFrag issue @see https://github.com/vercel/next.js/issues/11230
// plugins.push([
// "@babel/plugin-transform-react-jsx",
// {
// runtime: "classic",
// },
// ]);
module.exports = {
// we also need next/babel preset to work with Next
presets: [
[
"next/babel",
{
"styled-jsx": {
plugins: ["styled-jsx-plugin-postcss"],
},
"preset-react": {
runtime: "classic",
},
},
],
],
plugins,
babelrc: false,
};