Skip to content

functions NODE_ENV === production #473

Closed
@kentcdodds

Description

@kentcdodds

Ok, so here's a bit of an issue that I think will confuse a lot of people: netlify dev actually runs as if everything's in production (NODE_ENV=production), BUT it runs your develop script rather than your start script.

This is problematic because I expect to be able to run everything in development (like NODE_ENV=development) because the script is called dev and it runs my develop script. So it's confusing that my functions would run with NODE_ENV=production.

Does that make sense? I think this could probably be resolved if netlify dev just basically replaced netlify-lambda and ran the netlify-lambda serve script for me. What would be best is if netlify dev could find the script in my package.json that runs netlify-lambda serve and just run that, because my scripts looks like this:

"functions:build": "netlify-lambda build netlify/functions",
"functions:dev": "dotenv -e ./netlify/.env netlify-lambda serve netlify/functions",

If netlify dev just found the script that runs netlify-lambda serve and ran that, then I think this issue would be resolved as would netlify/netlify-dev-plugin#61 and netlify/netlify-dev-plugin#60.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions