NODE_ENV
NODE_ENV is set by the command, never by a file, and a value in the shell wins over the command:
NODE_ENV is set by the command, never by a file, and a value in the shell wins over the command:
dusk dev(Vite's dev server):development, unless the shell already setsNODE_ENV.dusk build:production, unless the shell already setsNODE_ENV.dusk startruns the built server, which is created withdev: false, so it is production whateverNODE_ENVsays.createHandlerwithout adevoption treatsNODE_ENV=productionas production (and then requiressecurity.allowedHosts). The generated server entries always passdev, so only code that callscreateHandleritself is affected.
A .env, .env.local, .env.[mode] or .env.public file never sets NODE_ENV: Dusk never copies that name from a file
into process.env, so a file cannot change the mode of the server or of the build.
The shell value is not only the server's. The client build defines process.env.NODE_ENV as the value the shell has, so
NODE_ENV=development dusk build ships a development bundle of the React-style libraries. Set it per command, and never in
a shared env file or in CI settings that other commands also use.