-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build on Deploy #216
Build on Deploy #216
Conversation
By analyzing the blame information on this pull request, we identified @drew-gross, @flovilmart and @hallucinogen to be potential reviewers. |
"webpack": "~1.12.0" | ||
}, | ||
"devDependencies": { | ||
"history": "~1.9.1", |
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.
history should not be dev I believe
While this looks really good, that makes all those dependencies get installed while you use NPM, which is something we obviously want to avoid as we distribute the package with solely the right folders. also, npm would fetch the devDependencies if NPM_CONFIG_PRODUCTION=false. I believe heroku sets NPM_CONFIG_PRODUCTION=true by default, removing it, would let all devDependencies to be downloaded, therefore you would be able to build on deploy, without impacting the uses using npm |
"pig": "http-server ./PIG -p 4041 -s & webpack --config webpack/PIG.config.js --progress --watch", | ||
"build": "NODE_ENV=production webpack --config webpack/production.config.js && webpack --config webpack/PIG.config.js", | ||
"test": "NODE_PATH=./node_modules jest", | ||
"generate": "node scripts/generate.js", | ||
"prepublish": "webpack --config webpack/publish.config.js --progress", | ||
"postinstall": "if [ -n \"$POST_INSTALL_BUILD\" ]; then npm run dist; fi", |
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.
you could use: "heroku-postbuild" (as described here)
@flovilmart Yea, some of those deps might just be copy/pasta errors. So is the general approach to not specify a |
I was mistaken about NODE_ENV, this is actually to sum up:
And that's it'! |
Ahh, gotcha. Heh, I actually didn't even realize Hunter added the |
testing right now but that seem fine the post build may not even be needed as prepublish will be run after npm install by npm itself and bundles the package by itself
So that sums it up by usr setting |
Yea, the problem was that it compiled everything, but didn't move/symlink it to |
yes prepublish runs, now I have a trouble with heroku, will keep you posted |
Ok, so it's all great, but we need to remove --progress in prepublish so it don't break on heroku. |
@mnoble I've remove the --progress that was making heroku build fail. So now the only thing to do I believe is to set the heroku env and you're good to go! |
Moves all build deps to
dependencies
(opposed todevDependencies
) so that the project can be built when deploying to production (like on Heroku, in this case). You enable this by setting thePOST_INSTALL_BUILD
.Also fixes an issue introduced after splitting up the backend/static express apps where
allowInsecureHTTP
was being referenced while never being defined.