Ngx-admin: Documentation to deploy the application on Heroku

Created on 13 Sep 2016  路  1Comment  路  Source: akveo/ngx-admin

  • I'm submitting a ...
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
  • Do you want to request a _feature_ or report a _bug_?

A feature

  • What is the current behavior?

Files are created in the dist folder

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
  • What is the expected behavior?

Generate a script for deploying on Heroku (package.json preinstall script & dependencies + Procfile)
npm run prebuild:prod && npm run build:prod && npm run deploy:heroku

  • What is the motivation / use case for changing the behavior?

Simplify the deployment process

  • Please tell us about your environment:
  • Angular version: 2.0.0-rc.5
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Currently webpack allows to create a dist folder that we can deploy on any server.
But after that how can we configure heroku to run the application with http-server ?
Is it better to build the application directly from the server by providing him the source code and dependencies or upload the dist file with a specific package.json ?

Most helpful comment

What I did to deploy to heroku was:

  • Remove dist from .gitignore
  • Add "postinstall": "npm run clean:dist && webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail" to package.json scripts
  • put following in Procfile: web: npm run server:prod

Now, running npm install locally will also build the project, after which pushing to heroku just leaves to running the server.
I first tried building on heroku as well, but it seemed there was not enough memory available in RAM to do so..

>All comments

What I did to deploy to heroku was:

  • Remove dist from .gitignore
  • Add "postinstall": "npm run clean:dist && webpack --config config/webpack.prod.js --progress --profile --colors --display-error-details --display-cached --bail" to package.json scripts
  • put following in Procfile: web: npm run server:prod

Now, running npm install locally will also build the project, after which pushing to heroku just leaves to running the server.
I first tried building on heroku as well, but it seemed there was not enough memory available in RAM to do so..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mignam picture mignam  路  3Comments

burtonator picture burtonator  路  3Comments

yanyim picture yanyim  路  3Comments

lopn picture lopn  路  4Comments

myurAgarwal picture myurAgarwal  路  3Comments