4

"production" environment is specified in "to a node.js hosting provider" section of docpad's deploy guide while "static" is specified in "to static servers" section.

What is the real difference between both? And is is safe to use custom environment name?

Sergey Lukin
  • 471
  • 2
  • 17

1 Answers1

3

There are a few parts to this.

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

  • docpad <action> will run in the development environment
  • docpad <action> --env static will run in the static environment
  • docpad <action> --env production will run in the production environment

Now the default configuration is actually assumed to be the configuration for your production environment, with the development, static, and whatever other environment actually extending your default (production) configuration via the environments configuration property. You can see the special environment configuration the DocPad core specifies here.

Plugins will also specify custom environment configuration as well. So for instance the clean urls plugin will by default just rely on the DocPad node.js server to do the clean urls, but if we are running in a static environment, then it will write special static redirect files instead. Here is the code for how it does it.

balupton
  • 47,113
  • 32
  • 131
  • 182