demo/registry.js
function deepRegister(r) {
  r.keys().forEach(key => {
    const component = r(key)
    registry.register(component.default, component.registryName)
  })
}
function deepRegister(r) {
  r.keys().forEach(key => {
    const component = r(key)
    registry.register(component.default, component.registryName)
  })
}
function deepRegister ( r ) { r . keys ( ) . forEach ( key => { const component = r ( key ) registry . register ( component . default , component . registryName ) } ) }
The require context passed to deepRegister has a keys method for iterating through all matched imports. Calling require on a key returns a cjs module that we use to register the component
The require context passed to deepRegister has a keys method for iterating through all matched imports . Calling require on a key returns a cjs module that we use to register the component