1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Allow extending transform-runtime without loosing next defaults (#5022)

**Example:**

https://github.com/zeit/next.js/blob/canary/examples/with-configured-preset-env/.babelrc#L17-L20
This commit is contained in:
HaNdTriX 2018-08-24 10:27:48 +02:00 committed by Tim Neutkens
parent e11d08ae45
commit d6676e6e2b

View file

@ -37,9 +37,10 @@ module.exports = (context, opts = {}) => ({
require('./plugins/react-loadable-plugin'),
[require('@babel/plugin-proposal-class-properties'), opts['class-properties'] || {}],
require('@babel/plugin-proposal-object-rest-spread'),
[require('@babel/plugin-transform-runtime'), opts['transform-runtime'] || {
[require('@babel/plugin-transform-runtime'), {
helpers: false,
regenerator: true
regenerator: true,
...opts['transform-runtime']
}],
[require('styled-jsx/babel'), styledJsxOptions(opts['styled-jsx'])],
process.env.NODE_ENV === 'production' && require('babel-plugin-transform-react-remove-prop-types')