There are several parts to this.
The environment is specified by the CLI flag --env :
docpad <action> will be launched in development environmentdocpad <action> --env static will run in a static environmentdocpad <action> --env production will be launched in the production environment
Currently, the default configuration is actually considered a configuration for your production environment with development , static and any other environment that actually extends your default configuration (production) using the environments configuration property. You can see the special configuration of the environment in which the DocPad core points here .
Plugins will also determine the configuration of the custom environment. So, for example, a clean default URL plugin will simply rely on the DocPad node.js server to make clean URLs, but if we are working in a static environment, it will write special static redirect files instead. Here is the code of how he does it.
source share