File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -101,19 +101,25 @@ export default async (
101101 const presets = babelrc . presets || [ ]
102102 const plugins = babelrc . plugins || [ ]
103103
104- presets . unshift ( {
105- plugins : [
106- [
107- babelPluginReactIntl ,
108- Object . entries ( pluginOptions ) . reduce ( ( acc , [ key , value ] ) => {
109- if ( babelPluginReactIntlOptions . includes ( key ) ) {
110- return { ...acc , [ key ] : value }
111- }
112- return acc
113- } , { } )
104+ if (
105+ ! plugins . find ( plugin =>
106+ ( Array . isArray ( plugin ) ? plugin [ 0 ] : plugin ) === 'react-intl'
107+ )
108+ ) {
109+ presets . unshift ( {
110+ plugins : [
111+ [
112+ babelPluginReactIntl ,
113+ Object . entries ( pluginOptions ) . reduce ( ( acc , [ key , value ] ) => {
114+ if ( babelPluginReactIntlOptions . includes ( key ) ) {
115+ return { ...acc , [ key ] : value }
116+ }
117+ return acc
118+ } , { } )
119+ ]
114120 ]
115- ]
116- } )
121+ } )
122+ }
117123
118124 const extractFromFile = async ( file : string ) => {
119125 const babelOpts = {
You can’t perform that action at this time.
0 commit comments