ionic-better-structure icon indicating copy to clipboard operation
ionic-better-structure copied to clipboard

How to deploy it to ionic view

Open phsacramento opened this issue 8 years ago • 3 comments

When i try upload this to ionic view i receive a error message

An error occurred uploading the build: Error: ENOENT: no such file or directory, open app-folder/www.zip'

phsacramento avatar May 20 '16 13:05 phsacramento

The problem here is that the ionic CLI is using the documentRoot value from ionic.project file for upload. But this value is also used for the serve task. Since the folder from where the project is served during deployment (with live-reload) is a different one then the one that is used for the production files that are uploaded, I unfortunately don't have an easy solution, yet. A quick fix would be to:

  1. run ionic build in order to build the app into the www directory
  2. Temporarily change the documentRoot value in ionic.profile from src to www
  3. run ionic upload
  4. Change back the documentRoot value in ionic.profile from www to src

I'll look into how this can be optimized.

davidruisinger avatar May 25 '16 22:05 davidruisinger

Additional note: Also the CLI currently has the temp zip file hardcoded https://github.com/driftyco/ionic-app-lib/blob/master/lib/upload.js#L17

davidruisinger avatar May 25 '16 22:05 davidruisinger

A possible solution would be to always re-build the project for live-reload and then serve from the www directory instead of src. I'll look into that when I have a bit more time ;)

davidruisinger avatar May 25 '16 22:05 davidruisinger