1
0
Fork 0
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:
Tim Neutkens 2018-06-19 21:48:54 +02:00 committed by GitHub
parent bf882eb60c
commit fc2d59de4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -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,

View file

@ -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": []