ionic-better-structure
ionic-better-structure copied to clipboard
How to deploy it to ionic view
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'
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:
- run
ionic build
in order to build the app into the www directory - Temporarily change the documentRoot value in
ionic.profile
fromsrc
towww
- run
ionic upload
- Change back the documentRoot value in
ionic.profile
fromwww
tosrc
I'll look into how this can be optimized.
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
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 ;)