require('./loaderHook')()
before any require statements with the non-js files you're looking to load.
Loader hook can take an options object, of which the defaults are:
{
extensions: ['.png', '.jpg'],
filePrefix: 'img/img-',
hashLength: 6
}
Establishes the module exports for the provided file extensions so that requiring those files will return the hashed file path.
Should leverage webpack config for loader so that exported path matches what's generated by the bundle.