You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1307,6 +1307,32 @@ Here's an example `.babelrc` file:
1307
1307
}
1308
1308
```
1309
1309
1310
+
The `next/babel` preset includes everything needed to transpile React applications. This includes:
1311
+
1312
+
- preset-env
1313
+
- preset-react
1314
+
- plugin-proposal-class-properties
1315
+
- plugin-proposal-object-rest-spread
1316
+
- plugin-transform-runtime
1317
+
- styled-jsx
1318
+
1319
+
These presets / plugins **should not** be added to your custom `.babelrc`. Instead you can configure them on the `next/babel` preset:
1320
+
1321
+
```json
1322
+
{
1323
+
"presets": [
1324
+
["next/babel", {
1325
+
"preset-env": {},
1326
+
"transform-runtime": {},
1327
+
"styled-jsx": {}
1328
+
}]
1329
+
],
1330
+
"plugins": []
1331
+
}
1332
+
```
1333
+
1334
+
The `modules` option on `"preset-env"` should be kept to `false` otherwise webpack code splitting is disabled.
1335
+
1310
1336
#### Exposing configuration to the server / client side
1311
1337
1312
1338
The `config` key allows for exposing runtime configuration in your app. All keys are server only by default. To expose a configuration to both the server and client side you can use the `public` key.
0 commit comments