RIA Builder

PHP Application for build html, css, less, js files to one file. Is very simple method to compile JavaScript application for production.
Library uses only PHP so you do not need to install other applications to compress less and minify css.

Source code
github.com/affka/riaBuilder
Where used
HelpOnClick

Features

  • Supported formats are JavaScript, CSS, LESS, HTML;
  • Loading inside modules;
  • Loading files by mask (*.js);
  • Compilationg and minification of LESS to CSS files only by using PHP interpreter;
  • Include js/css/template by browser conditions;
  • Build package from command line or dynamically from php;
  • Add function–wrappers for JavaScript code;
  • Main code have unit tests.

Example

Suppose we have a simple application

testapp/style_ie6.less
@color: red;
body {
    color: @color;
}
and testapp/main.js
function a(message) {
    alert(message);
}

Create package.json for build

{
    "include": [
        {
            "type": "less",
            "files": [
                "styles_ie6.less"
            ],
            "browser": "ie <=6"
        },
        "*.js"
    ]
}

Build package, for example through the console

/var/www/riabuilder/run -c testapp

As result we have testapp_min.js file with following content

... // Javascript part of RIABuilder library
if (RIABuilder.matchBrowser("ie <9")){RIABuilder.appendStyle("body {color: red;}");}
function a(m) {alert(m);}

Fields of application

Library can be used for small or middle size web–applications, because it does not have files relations tracking. I used it for some projects. You can see more information GitHub.