denali-js / core

An opinionated, ORM agnostic framework for building robust JSON APIs in Node
http://denalijs.org
Apache License 2.0
73 stars 14 forks source link

Pass in --environment production to denali publish #397

Closed seawatts closed 6 years ago

seawatts commented 6 years ago

Closes https://github.com/denali-js/denali-cli/issues/35

davewasmer commented 6 years ago

I think we actually want to use an environment variable. This -- syntax with npm run means the remaining arguments will be passed to the script that npm run build executes, but we can't guarantee that will be denali build - someone may introduce their own build/prebuild script that invokes denali build along the way. But if we set an environment variable, that has a much better chance of surviving through whatever build script the user adds and making it to the denali build process.

seawatts commented 6 years ago

Will denali build in production if we set NODE_ENV=production?

davewasmer commented 6 years ago

It should, although I'm not 100% sure it does.

davewasmer commented 6 years ago

Closing for lack of activity.

This is something we want to do though (build for production on publish). But see the comments above: environment variable is likely the best way to accomplish this.

If anyone is interested in carrying this across the finish line: we need to verify that NODE_ENV actually does set the environment during build, and then set it here.