InjectAMD/CJS 依賴(lài)管理器
Inject 是 AMD 和 CJS 依賴(lài)管理器,它以一種 Library Agnosti c 的方式來(lái)管理你的依賴(lài)。主要特性包括:
-
基于瀏覽器的 CommonJS 規(guī)范
-
查看更完整的 CommonJS Support Matrix
-
-
跨域檢索文件的Cross domain retrieval of files (via easyXDM)
-
本地存儲(chǔ) (一次加載一個(gè)模塊)
-
十分簡(jiǎn)單
快速配置
// Set the "root" where all your modules can be found
// you can use an http:// path or just /path/to/modules like above
Inject.setModuleRoot("path");
// Specify how long files should be in localStorage (in minutes)
// or 0 for never, which is great for development
Inject.setExpires(integerValue);
// configure "cross domain" support. You need to put "relay.swf" and "relay.html"
// on your remote server for this to work
Inject.setModuleRoot("http://example-cdn.com/modules");
Inject.setCrossDomain({
relayHtml: "http://example-cdn.com/relay.html",
});
評(píng)論
圖片
表情
