diff --git a/lib/bin/cli.js b/lib/bin/cli.js index 39c952aeba570..17649c4f6e479 100644 --- a/lib/bin/cli.js +++ b/lib/bin/cli.js @@ -41,6 +41,9 @@ program.command('build') .description('Build a Gatsby project.') .option('--prefix-links', 'Build site with links prefixed (set prefix in your config).') .action((command) => { + // Set NODE_ENV to 'production' + process.env.NODE_ENV = 'production' + const build = require('../utils/build') const p = { ...command,