fix(cli): If NODE_ENV is not defined then default to production for medusa start (#11325)

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Kasper Fabricius Kristensen
2025-02-06 17:56:29 +01:00
committed by GitHub
parent 7d208afb07
commit f13c1215cb
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/cli": patch
---
fix(cli): If NODE_ENV is not defined then default to "production" for medusa start

View File

@@ -422,7 +422,7 @@ function buildLocalCommands(cli, isLocalProject) {
}),
handler: handlerP(
getCommandHandler(`start`, (args, cmd) => {
process.env.NODE_ENV = process.env.NODE_ENV || `development`
process.env.NODE_ENV = process.env.NODE_ENV || `production`
cmd(args)
// Return an empty promise to prevent handlerP from exiting early.
// The development server shouldn't ever exit until the user directly