Melchior.js- JavaScript 模块加载器
JavaScript 常用JavaScript包
共0Star
详细介绍
Melchior.js
是一个模式加载器,提供通过链式模块定义的API,让你可以远离那些长长的AMD定义和重复的模块名。它起步非常容易,定制方便,而且压缩版只有3KB。
在线演示
示例代码:
// create modulemelchiorjs.module('yourModule')// define dependencies.require('dependencyUno')
.require('dependencyDuo', 'duo')// define module body.body(function () { // `dependencyUno` is available here!
dependencyUno.doSomething(); // aliased `dependencyDuo` is available as `duo`!
duo.doSomething(); // return methods for other modules
return {
method: function () { ... },
anotherMethod: function () { ... }
};
});
配置:
melchiorjs.config({
paths: { 'jQuery': 'path/to/jquery', 'underscore': 'path/to/underscore', 'myModule': 'path/to/myModule'
}, // provide shim to non-melchior modules if needed
// declare globals returned by libraries and deps
shim: {
underscore: {
exports: '_'
}
}
});
支持的浏览器:
[![](/static/assets/osapp/images/23b50bd826c817b90400a1f28ab8a30a.png)](https://camo.githubusercontent.com/3bfe3f8c64cf4e968b3d45f587c291853a1b8035/68747470733a2f2f7261772e6769746875622e636f6d2f616c7272612f62726f777365722d6c6f676f732f6d61737465722f6368726f6d652f6368726f6d655f34387834382e706e67) | [![](/static/assets/osapp/images/1e531136c33b281b5efac03e4a5450b7.png)](https://camo.githubusercontent.com/0a3d07e334548501ef5b7c20a75fc1a4e9457566/68747470733a2f2f7261772e6769746875622e636f6d2f616c7272612f62726f777365722d6c6f676f732f6d61737465722f66697265666f782f66697265666f785f34387834382e706e67) | [![](/static/assets/osapp/images/f9451f0a395bf53202f41e32ab90db3d.png)](https://camo.githubusercontent.com/439d1528b7dc0a003ff74eaeb1fe30d24bb6c904/68747470733a2f2f7261772e6769746875622e636f6d2f616c7272612f62726f777365722d6c6f676f732f6d61737465722f696e7465726e65742d6578706c6f7265722f696e7465726e65742d6578706c6f7265725f34387834382e706e67) | [![](/static/assets/osapp/images/e061dbfe3f728d47ad159d32d887e73f.png)](https://camo.githubusercontent.com/ef1c2ea75ec9ec27156ec690f03b8b44e9c0e996/68747470733a2f2f7261772e6769746875622e636f6d2f616c7272612f62726f777365722d6c6f676f732f6d61737465722f6f706572612f6f706572615f34387834382e706e67) | [![](/static/assets/osapp/images/19e341d6e6c07069a48e244034da749a.png)](https://camo.githubusercontent.com/7e8c82eab10c4686d5d94a5875ba436750ac33d7/68747470733a2f2f7261772e6769746875622e636f6d2f616c7272612f62726f777365722d6c6f676f732f6d61737465722f7361666172692f7361666172695f34387834382e706e67) |
---|---|---|---|---|
1+ ✔ | 2+ ✔ | 8+ ✔ | 10+ ✔ | 3+ ✔ |
-
0 Star
-
0 Star
-
0 Star
-
12566 Star
-
0 Star
-
297 Star
-
563 Star
-
0 Star
-
0 Star
-
0 Star