webmodules / bootloader
模块加载器
0.2.0
2017-10-06 18:02 UTC
Requires
- webmodules/foo: >=3.2.6
- webmodules/headjs: >=1.0.3
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 };