* Adds the versioned path for an asset to the view
* @filename The asset path to find relative to the includes convention directory
* @buildDirectory The build directory inside the includes convention directory
* @sendToHeader Send to the header via htmlhead by default, else it returns the content
* @async HTML5 JavaScript argument: Specifies that the script is executed asynchronously (only for external scripts)
* @defer HTML5 JavaScript argument: Specifies that the script is executed when the page has finished parsing (only for external scripts)
boolean sendToHeader=true,
elixirPath( arguments.fileName ),
* Finds the versioned path for an asset if leveraging ColdBox Elixir
string function elixirPath( required string fileName ){
var includesConvention = "includes";
var mapping = event.getCurrentModule() != "" ? event.getModuleRoot() : controller.getSetting( "appMapping" );
var filePath = expandPath( "#mapping#/#includesConvention#/manifest.json" );
var href = "#mapping#/#includesConvention#/#arguments.fileName#";
if ( ! fileExists( filePath ) ) {
var fileContents = fileRead( filePath );
if ( ! isJSON( fileContents ) ) {
var json = deserializeJSON( fileContents );
if ( ! structKeyExists( json, arguments.fileName ) ) {
return "#mapping#/#includesConvention#/#json[ arguments.fileName ]#";