mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add class properties configuration (#4619)
This commit is contained in:
parent
bf882eb60c
commit
fc2d59de4d
|
@ -34,7 +34,7 @@ module.exports = (context, opts = {}) => ({
|
||||||
plugins: [
|
plugins: [
|
||||||
require('babel-plugin-react-require'),
|
require('babel-plugin-react-require'),
|
||||||
require('./plugins/handle-import'),
|
require('./plugins/handle-import'),
|
||||||
require('@babel/plugin-proposal-class-properties'),
|
[require('@babel/plugin-proposal-class-properties'), opts['class-properties'] || {}],
|
||||||
require('@babel/plugin-proposal-object-rest-spread'),
|
require('@babel/plugin-proposal-object-rest-spread'),
|
||||||
[require('@babel/plugin-transform-runtime'), opts['transform-runtime'] || {
|
[require('@babel/plugin-transform-runtime'), opts['transform-runtime'] || {
|
||||||
helpers: false,
|
helpers: false,
|
||||||
|
|
|
@ -1342,7 +1342,7 @@ The `next/babel` preset includes everything needed to transpile React applicatio
|
||||||
- plugin-transform-runtime
|
- plugin-transform-runtime
|
||||||
- styled-jsx
|
- styled-jsx
|
||||||
|
|
||||||
These presets / plugins **should not** be added to your custom `.babelrc`. Instead you can configure them on the `next/babel` preset:
|
These presets / plugins **should not** be added to your custom `.babelrc`. Instead, you can configure them on the `next/babel` preset:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
@ -1350,7 +1350,8 @@ These presets / plugins **should not** be added to your custom `.babelrc`. Inste
|
||||||
["next/babel", {
|
["next/babel", {
|
||||||
"preset-env": {},
|
"preset-env": {},
|
||||||
"transform-runtime": {},
|
"transform-runtime": {},
|
||||||
"styled-jsx": {}
|
"styled-jsx": {},
|
||||||
|
"class-properties": {}
|
||||||
}]
|
}]
|
||||||
],
|
],
|
||||||
"plugins": []
|
"plugins": []
|
||||||
|
|
Loading…
Reference in a new issue