Commit 4347fa4d authored by Dmitry Vasilev's avatar Dmitry Vasilev Committed by Tim Neutkens

Add babel option to use styled-jsx/babel-test in the preset (#7747)

* Add babel option to use styled-jsx/babel-test in the preset

* Fix the types
parent 17773a62
...@@ -7,7 +7,8 @@ const isTest = env === 'test' ...@@ -7,7 +7,8 @@ const isTest = env === 'test'
type StyledJsxPlugin = [string, any] | string type StyledJsxPlugin = [string, any] | string
type StyledJsxBabelOptions = type StyledJsxBabelOptions =
| { | {
plugins?: StyledJsxPlugin[] plugins?: StyledJsxPlugin[],
'babel-test'?: boolean
} }
| undefined | undefined
...@@ -104,7 +105,7 @@ module.exports = ( ...@@ -104,7 +105,7 @@ module.exports = (
...options['transform-runtime'], ...options['transform-runtime'],
}, },
], ],
[require('styled-jsx/babel'), styledJsxOptions(options['styled-jsx'])], [(isTest && options['styled-jsx'] && options['styled-jsx']['babel-test']) ? require('styled-jsx/babel-test') : require('styled-jsx/babel'), styledJsxOptions(options['styled-jsx'])],
require('./plugins/amp-attributes'), require('./plugins/amp-attributes'),
isProduction && [ isProduction && [
require('babel-plugin-transform-react-remove-prop-types'), require('babel-plugin-transform-react-remove-prop-types'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment