interface IUserConfig { babelPlugins : string [ ] ; } const plugin = ( { applyMethod , modifyUserConfig } ) => { modifyUserConfig ( ( userConfig ) => { const { babelPlugins = [ ] } = userConfig ; return { babelPlugins : babelPlugins . concat ( 'react-activation/babel' ) , } ; } ) ; const exportMembers = [ 'withActivation' , 'fixContext' , 'useActivate' , 'useUnactivate' , 'createContext' , 'withAliveScope' , 'useAliveController' , 'KeepAlive' , 'NodeKey' , ] ; applyMethod ( 'addExport' , { source : 'react-activation' , exportName : exportMembers . join ( ',' ) , specifier : `{ ${ exportMembers . join ( ',' ) } }` , importSource : 'react-activation' , exportMembers , } ) ; } ; export default plugin ;