Workflow - shovemedia/GigaJS GitHub Wiki

Giga is built from AMD JavaScript modules. This allows highly modular, reusable code without polluting the global namespace. It also allows concatenating and minifying the JavaScript before production deployment. But minified JavaScript is impossible to debug; nor should the developer be forced to do a full build every time they make an adjustment. In addition, there are occasionally issues introduced by aggressive minification.

We need to be able to run our sites in a few different modes depending on the task at hand. The demo sites' index.php templates illustrate how to configure a single environment variable that will put our site into one of three modes:

Dev

In development mode, all JavaScript modules will be loaded one-at-a-time via require.js from their original source master source files. This takes longer because of the larger filesizes and increased number of HTTP requests. However, the advantage is that no build is required.

Build

In build mode, all JavaScript modules are concatenated into a single (un-minified) JavaScript file. Make sure to run ant build from the command line to see your latest changes.

Production

In production mode, all JavaScript modules are concatenated *and* minified into a single JavaScript file. Make sure to run ant build from the command line to see your latest changes.

Simply set the Giga environment to "dev", "build", or "production" at the top of the site template (index.php)

$g = new giga('/site');
$g->environment = 'production'; // dev, build, or production
⚠️ **GitHub.com Fallback** ⚠️