Bringing CommonJS-style requires to the browser and more.
npm install webant_Bringing CommonJS-style requires to the browser and more._
__Require javascript__
```javascript``
/**
* path/to/foo.js
* Export a simple function
*/
module.exports.sayHello = function() {
alert("Hello!");
};
``javascript``
/**
* 'foo' contains the exports from ./path/to/foo.js
*/
var foo = require("./path/to/foo.js");
foo.sayHello(); // alerts "Hello!"
__Require javascript asynchronously__
``javascript``
/**
* 'foo' contains the exports from ./path/to/foo.js
* Webant also attempts to place './path/to/foo.js' in a separate file and load it only when necessary.
*/
require("./path/to/foo.js",function(foo){
foo.sayHello();
});
__Require multiple javascripts asynchronously__
``javascript``
/**
* 'foo' and 'bar' contain the exports from ./path/to/foo.js and ./path/to/bar.js respectively
*/
require(["./path/to/foo.js","./path/to/bar.js"],function(foo,bar){
foo.sayHello();
bar.sayGoodbye();
});
__Require HTML, CSS, handlebars templates, JSON, stylus, LESS, SCSS...__
``javascript
/**
* A