require-mapper

Maps the project's local modules for an easy require access

require-mapper

Maps the project's local modules for an easy require access.
With simple key value mapping, the project's modules can be addressed more easily

require("require-mapper").map({
    data:{
        "my.module": "src/My.js"
    }
  });
  

Load your module using the map's keys like that:

_require("my.module")
  
  • methodname - The method name to be used for require the modules
  • basepath - The base path for resolving the modules
  • data - The modules map
require("require-maper").init({
    methodname: "requirexxx"
    basepath: "../",
    data:{
        "foo.module": "src/foo/Foo.js"
    }
  });

// use your custom require method name requirexxx("foo.module");

By default the base path set to "."