webmodules/bootloader

Module loader

Installs: 86

Dependents: 3

Suggesters: 0

Security: 0

Stars: 1

Watchers: 9

Forks: 2

Open Issues: 0

Language:JavaScript

0.2.0 2017-10-06 18:02 UTC

README

Module Dependency Loader with bundlify

Including Library

<!DOCTYPE html>
<html>
<head>
<title>MyApp</title>
</head>
<body>
    <script src="/dist/bootloader_bundled/webmodules.bootloader.js?version=beta-5.7&debug=false">
        bootloader({
            appContext: '',
            indexBundle: "myapp/app",
            debugBundles: [],
            apiServer: "/data/"
        });
	</script>
</body>

</html>

define

define({
  module : "my.module",
  extend : "my.parent",
  using : ["mod1","mod2","mod3"]
}).as(function(MyModule,mod1,mod2,mod3){
  
  return {
    _define_ : function(){
    },
    _instance_ : function(){
    },
    _extended_ : function(){
    },
    _ready_ : function(){
    
    }
  };
  
})

module

module(["module1","module2"], function(module1,module2){
  
});

importStyle

Import StyleSheets packages recursively as mentioned in module.json

__importStyle__("style/package/name");

Hooks

bootloader.module404 =  function(moduleName){
  //finally raise alert when module not found
};