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:
1<?php23return [4 'staging' => true,5 'company' => 'Tighten',6];
You can override the
staging variable in your production environment by creating a new file called
1<?php23return [4 'staging' => false,5];
This file is merged on top of
config.php, so you only need to specify the variables that you are changing.
Building files for a specific environment
To build files for a specific environment, just pass the environment name as an argument when running the
1vendor/bin/jigsaw build production
Alternatively, if you are using Laravel Mix to compile your assets, you can run the
production script found in
1npm run prod
This will generate your site into a new folder called
build_production, leaving your
build_local folder untouched.