Guest User

Untitled

a guest
Jan 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var imports = {};
  2.  
  3. function importAll(r) {
  4. r.keys().forEach(key => {
  5. const module = r(key);
  6. const name = key.split("./")[1].split(".")[0];
  7. imports[name] = module.default;
  8. });
  9. }
  10.  
  11. importAll(require.context("./", true, /\.jsx$/));
  12.  
  13. module.exports = imports;
Add Comment
Please, Sign In to add comment