Skip to content
  1. Extras
  2. MinifyX

MinifyX

Automate compression and chaching of scrips and styles on the site.

Parameters

NameDescription
&cacheFolderfolder to keep ready files.
&cssFilenamebasic name of ready CSS file.
&cssPlaceholdername of CSS placeholder. It is used if &registerCss=`placeholder`
&cssSourceslist of CSS files for handling. «*.css», «*.less» и «*.scss» can be indicated.
&forceUpdatedisable the check of file updating and every time generate new scripts and styles.
&jsFilenamebasic name for ready JS file.
&jsPlaceholdername of placeholder javascript. It is used if &registerJs=`placeholder`
&jsSourceslist of JS files for handling. «*.js» и «*.coffee» can be indicated.
&minifyCssinitiate CSS modification?
&minifyJsinitiate JS modification?
&registerCssconnection of css: can be saved in placeholder «placeholder» or activated in tag <head> - «default».
&registerJsconnection of javascript: can be saved in placeholder «placeholder», activated in tag <head> - «startup» or place before closing <body> - «default».

Samples

Output of snippet with auto style registration before </head> and scripts before </body>:

modx
[[MinifyX?
  &minifyCss=`1`
  &minifyJs=`1`
  &registerCss=`default`
  &registerJs=`default`
  &cssSources=`
    assets/templates/himyf/css/normalize.css,
    assets/templates/himyf/css/foundation.css,
    assets/templates/himyf/css/font-awesome.css,
    assets/templates/himyf/css/app.css
  `
  &jsSources=`
    assets/templates/himyf/js/foundation.js
  `
]]

Output of snippet work to placeholders &cssPlaceholder on default [[+MinifyX.css]] and &jsPlaceholder on default [[+MinifyX.javascript]]:

modx
[[MinifyX?
  &minifyCss=`1`
  &minifyJs=`1`
  &cssSources=`
    assets/templates/himyf/css/normalize.css,
    assets/templates/himyf/css/foundation.css,
    assets/templates/himyf/css/font-awesome.css,
    assets/templates/himyf/css/app.css
  `
  &jsSources=`
    assets/templates/himyf/js/foundation.js
  `
]]
[[+MinifyX.css]]
[[+MinifyX.javascript]]