I am trying to use cfstatic. In my index.cfm, I am adding only green.css using cfstatic, cfstatic should add minimized version of green.css only, So my h1 text <h1>I should be Green</h1>
should be in green color. But cfstatic is adding both green.css & red.css. Am I missing configuration?
Application.cfc
component output="false"{
This.name = "testing";
This.sessionManagement = true;
This.sessionTimeout = CreateTimeSpan(1, 23, 59, 59);
This.mappings["/org"] = expandpath('.')&'\org';
function onRequestStart(){
application.cfstatic = CreateObject( 'org.cfstatic.CfStatic' )
.init( staticDirectory = ExpandPath('./assets'),
staticUrl = "/cfstatic/assets/"
);
}
}
Index.cfm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<cfscript>
application.cfstatic.include( '/css/green.css',true );
</cfscript>
<cfoutput>#application.cfstatic.renderIncludes('css')#</cfoutput>
</head>
<body>
<h1>I should be Green</h1>
</body>
</html>
Green.css
/* This is assets/css/green.css */
h1 {color:green;}
Red.css
/* This is assets/css/red.css */
h1 {color:red;}
My Browser output is,