I am trying to run an express app using Next.js. I have mostly got it under control, but for some reason the package.json does assign NODE_ENV to the correct value, but the comparing the two does not seem to work.
Scripts in json:
"scripts": {
"dev": "nodemon start server.js",
"build": "next build",
"start": "set NODE_ENV=production && node server.js"
},
The app:
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
No matter what I do, it seems to assign the value correctly, but the comparison always returns true. If I try to do an if-else statement using == or === it all passes as it doesn't match. I've console them both in tandem, adding a number to the end to see the difference, and everything aside the added number was correct.