node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



Require externally hosted javascript and CSS files with webant


There should be no need to install this module since it's required by the webant module by default.

If for some reason you'd like to use the module outside of webant, install as follows:

$ npm install webant-handler-external


Ensure the external handler is present in your webant configuration file.

An example configuration file which uses this handler may look like this:


Note that both htmlEntryPath and htmlDestPath must be defined to make full use of this handler.

You may now require CSS files via the comment style:


All external files required this way can be accessed in the handlebars file at htmlEntryPath as follows:

<!DOCTYPE html>
        {{#each externalCss}}<link rel="stylesheet" type="text/css" href="{{{this}}}" />{{/each}}
        {{#each externalJs}}<script type="text/javascript" src="{{{this}}}"></script>{{/each}}

See the webant module for more information.


$ npm test