Brought to you by Tighten Co.
Often you might want to use different site variables in your development and production environments. For example, in production you might want to render your Google Analytics tracking snippet, but not include it in development so you don't skew your results.
Jigsaw makes this simple by allowing you to create additional
config.php files for your different environments.
Say your base
config.php file looks like this:
<?php return [ 'staging' => true, 'company' => 'Tighten Co', ];
You can override the
staging variable in your production environment by creating a new file called
<?php return [ 'staging' => false, ];
This file is merged on top of
config.php, so you only need to specify the variables that you are changing.
To build a specific environment, just pass the environment name as an argument when running
$ jigsaw build production
This will generate your site into a new folder called
build_production, leaving your
build_local folder untouched.