Difference between static and production environments in docpad

the "production" environment is indicated in " in node.js hosting provider " in the docpad deployment guide, while the "static" one is specified in the to static servers section.

What is the difference between both? And is it safe to use a user environment name?

+4
source share
1 answer

There are several parts to this.

The environment is specified by the CLI flag --env :

  • docpad <action> will be launched in development environment
  • docpad <action> --env static will run in a static environment
  • docpad <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.

+3
source

Source: https://habr.com/ru/post/1489367/


All Articles