PAX bundles JavaScript, CSS, optional Sass, and npm packages into public/app.js and public/app.css. No Node.js is required on the server.
The manifest for npm dependencies and build order.
{
"dependencies": {
"pax-js-framework": "0.0.158"
},
"build": {
"scss": ["*"],
"css": ["*"],
"js": ["*"]
}
}
| Key | Description |
|---|---|
| dependencies | npm packages downloaded to front/lib/ |
| build.js | JS files from front/js/ — use "*" for all files |
| build.css | CSS from front/css/ |
| build.scss | Sass compiled to front/cache/css/ before concat |
Build patterns: "*", "app.js", or "utils/*.js". Files are concatenated in alphabetical order.
| Setting | Behavior |
|---|---|
| SITE_BUILD=1 | Auto-rebuild when source files change (development) |
| SITE_BUILD=0 | No builds — serve committed public/ files (production) |
| /dev/build | Force rebuild when SITE_BUILD=1, then redirect home |
// template.php (default build hook)
$pkg = $app->get('package');
if(SITE_BUILD && $pkg->needsBuild()) $pkg->build();
cp .env.example .env
composer install
Set SITE_BUILD=1 in .env for local development. Sass requires scssphp/scssphp from Composer.
Templates link bundled assets with cache busting:
<link rel="stylesheet" href="/public/app.css?v=<?=filemtime(FILE_CSS)?>">
<script src="/public/app.js?v=<?=filemtime(FILE_JS)?>"></script>
SITE_BUILD=0 and SITE_PROD=1public/app.js and public/app.cssSITE_PROD=1