I'm trying to deploy a Progressive Web App version of my Ionic 2 project to Heroku but it doesn't seem to work. What I'm trying is to use "Ionic build browser --prod" and then deploy the www folder, but I'm not getting any response from Heroku (Seems that nothing has being deployed)
相关问题
- Plugin with id 'com.google.gms.google-services
- How to specify memcache server to Rack::Session::M
- Connecting Python to a Heroku PostgreSQL DB?
- How to pass form data from Ionic 3 to PHP file?
- apk big size with ionic 4 build
相关文章
- Django/Heroku: FATAL: too many connections for rol
- Heroku Web Server Won't Start Locally
- Ionic 4: Hardware Back Button Reloading Applicatio
- Heroku push issue
- Why does Rake task enhancement differ between my l
- Push rejected, failed to detect set buildpack hero
- ionic - Copy/paste in input field in iOS 10 not wo
- Email With Rails 3 and Heroku Net::SMTPSyntaxError
The steps you are supposed to take:
Ionic build browser --prod
- creates the main.js file to be deployedGo to .gitignore file and remove the mentions of www/ so git picks it up and add these two lines so platforms browsers folder is picked up
Add these 2 libraries to your package.json (don't forget to run npm install)
Add a start to your npm scripts in package.json
Add server.js to your project folder with the following code:
Please note this code is only for ionic apps and not normal angular apps. At this point you can write
npm start
ornode server.js
in your cmd and you can test to see how it will run.Commit your code to heroku git using
git push heroku master
. Please note to have the heroku git on your remote list. You may dogit remote -v
to check if thats the case. If not get the url from the website and add it.Optional - Put the www/ folder back in .gitignore and
git rm --cached -r ./www
to delete them from your git. This is so your co workers wont have merge conflicts on your main.js everytime you commit. The same for platforms/browser.You are supposed to see heroku installing and deployed a node application in your enviornment after pushing to their git
NOTE If you are using Heroku you could probably do this with Heroku builds rather than playing with your git. https://github.com/heroku/heroku-builds