-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(build): Require correct dependencies for prod build #1855
Conversation
To test this, do: git clone https://github.com/simison/mean.git mean-simison
cd mean-simison
git checkout restructure-prod-build
npm install --production
NODE_ENV=production npm run start:prod |
I'd be especially interested to have @mleanos look at those protractor changes I made! You wrote that feature originally, right? |
FYI @Ghalleb tested this (#1852 (comment)) and says it seems to work fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I've tested this locally, and deployed to Heroku using Production environment settings. I ran into an issue with our gulp default
task, that I'll explain in a separate comment. However, these changes seem to accomplish their goals.
Out of curiosity, what should the production deployment flow look like? Should we run the tests?
I ran into an issue with our default Gulp task. It actually sets the NODE_ENV to "development". And the Procfile starts the app using If I remove the |
@mleanos I'm not really familiar with Heroku. What would you recommend? |
@mleanos On second thought:
'start': 'if [ $NODE_ENV == "production" ]; then npm run start:prod; else npm run start:dev; fi' ... but that test could be also at Gulpfile.js — might be even more clear to have it there? I'm not exactly sure how well bash conditionals work e.g. in Windows machines.
|
If you look at my PR #1854, I changed |
@Ghalleb thanks! So I'll merge this and that change can be done in your PR. |
Some of the dependencies required by
npm run start:prod
aren't currently installed withnpm install --production
.See #1852 for reference.
This also moves some of the
require
's in Gulpfile inside tasks so that they wouldn't be required if unrelated tasks are run (i.e.start:prod
task).Also changed several semver ranges from
^
to more strict~
.