interface RequireContext { keys ( ) : string [ ] ; ( id ) : any ; < T > ( id ) : T ; resolve ( id ) : string ; /** The module id of the context module. This may be useful for module.hot.accept. */ id : string ; } const req = require . context ( './svg' , false , /\.svg$/ ) ; const requireAll = ( requireContext ) => requireContext . keys ( ) . map ( requireContext ) ; requireAll ( req ) ;