Static Site Generator
With the native static package, you can generate a static version of any package and serve the files directly.
The site will be generated in the static/{package} folder, then you can configure the web server to use this folder as root directory.
Command
MW_ENVIRONMENT={environment} bin/magework static build {package} {baseUrl}
Example
For example, if your application contains a package named acme and you want to serve it at the URL https://www.example.com:
MW_ENVIRONMENT=default bin/magework static build acme https://www.example.com
Configuration
You can create a configuration file in the package to be generated to ignore routes or files.
<?php
// packages/acme/etc/static.php
$config = [
'acme' => [
'static' => [
'ignore_files' => [ // Regex only
'/(.*)README.md$/i',
'/(.*)CHANGELOG.md$/i',
'/(.*)LICENCE$/i',
],
'ignore_routes' => [ // Regex only
'/\/secret.html/i',
'/\/secret\/(.*)/i',
],
],
],
];