webmodules/bootloader

模块加载器

安装: 81

依赖者: 3

建议者: 0

安全: 0

星标: 1

关注者: 9

分支: 2

开放问题: 0

语言:JavaScript

0.2.0 2017-10-06 18:02 UTC

README

使用 bundlify 的模块依赖加载器

包括库

<!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

根据 module.json 中的说明递归地作为样式表包导入

__importStyle__("style/package/name");

钩子

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