In your webpack config, there are two options that can affect process.env:
- When you specify
config.target(seeconfig.target) - When you define the
process.envvariable viaDefinePlugin
Looking at your code, it looks like process.env might be undefined when both options.prerender and options.minimize are false.
You could fix this by always using an environment that defines process.env (ex: node), or by using DefinePlugin to assign a default value to the variable yourself.