C.31 JsMinTask

The JsMinTask minifies JavaScript files using JsMin. JsMin is bundled with Phing and does not need to be installed separately.

For more information on minifying JavaScript files see Douglas Crockford's introduction to minifying JavaScript files.

Table C.36: Attributes

NameTypeDescriptionDefaultRequired
targetDirStringPath where to store minified JavaScript filesnoneYes
suffixStringSuffix to append to the filenames.-minNo
failonerrorBooleanWhether an error while minifying a JavaScript file should stop the build or notfalseNo

C.31.1 Example

<jsMin targetDir="docroot/script/minified" failOnError="false">
  <fileset dir="docroot/script">
    <include name="**/*.js"/>
  </fileset>
</jsMin>

C.31.2 Supported Nested Tags

  • fileset

    JavaScript files to be minified.