alias webpack require.context()
npm install @wotermelon/require-context
const requireContext = require('@wotermelon/require-context')
const fileModules = requireContext('./', false, /\.js$/)
// {
// './index.js': module
// }
dir
Which directory to find, can be an absolute path.useSubdirectories
Whether to traverse subdirectories recursively. Defaule isfalse
.regExp
To match the file path.