const importAll = (r) => r.keys().map(r);
const importAllFrom = (dir) => importAll(require.context(dir, false, /\.(png|jpe?g|svg)$/))
Calling `importAllFrom("../images") throws an error 'webpack_require__(...).context is not a function'.
However the following code where I hardcode the directory name works just fine.
const importAll = (r) => r.keys().map(r);
const importAllFrom = (dir) => importAll(require.context("../images", false, /\.(png|jpe?g|svg)$/))
All the code is in the same react component.
Am I missing something really silly??