Ionic downloads from github - can I avoid doing this with each new app? - ionic-framework

I am new to Ionic and just getting used to it. However I have noticed that when I create an app files are download from github such as:
Downloading:
https://github.com/driftyco/ionic-app-base/archive/master.zip
Often working without internet access is there a way that files I might need can be downloaded once and stored locally?

Yes, you can avoid downloading it with each new app. When you wrote something like to
$ ionic start YourAppName tabs
tabs - is an alias to Ionic starter repository. You can replace with relative or absolute path to a local directory.
Check out more about start parameters there - Starting an Ionic App.
EDIT: I don't see a reason why the code below couldn't work. And Yes, you have to unpack your default app files to some folder.
$ ionic start YourAppName c:\Temp\ionic-app-base-master

The command ionic start myApp will always create your project with the latest version of Ionic. It will always download the github. Currently there is no how to create a new project without using the downlod of the github.
You can create a blank project and uses it as "boilerplate project" (ionic start myApp blank). Then, when necessary, to update the Ionic (newest version) go to the root of your project and run ionic lib update.

Just download all the templates once and use it whenever you need when you are offline. Ionic will always download latest bundle when you do:
ionic start MyApp

Related

I can't build ionic react app on IOS simulator

I'm trying to build an Ionic React project. I’m successfully compiling the project on the IOS simulator but It crashes when It opens. Error showing is
⚡️ ERROR: Unable to load public/index.html
⚡️ This file is the root of your web app and must exist before
⚡️ Capacitor can run. Ensure you’ve run capacitor copy at least
⚡️ or, if embedding, that this directory exists as a resource directory.
I have posted on ionic forum as well, Discussion Here
That means the app is not able to find the index.html file in the public folder.
If you run npx cap open ios it should open your Capacitor project in Xcode. There you should see a blue folder called public with the index.html on it.
If you don't see it, then first run npm run build and then npx cap copy.
If you still don't see it, check that the value of webDir in capacitor.config.json matches the folder to where react is building your app.

Create ionic4 project after ionic5 release

As ionic5 is now released, so now when I use this command ionic start myApp blank --type=angular ionic5 app is created, I can confirm this from ionic info command, I am wondering how can I create ionic4 project. The reason behind creating ionic4 project is I have one app in ionic3 and I want to upgrade that app to first in ionic4 and then to ionic5 instead of directly going to latest one because I don't yet know the breaking changes in ionic5 yet and I haven't yet worked on it as well
okay, I got ionic4 app by first creating project with command sudo ionic start myApp blank --type=angular and then when project was created, then using sudo npm i #ionic/angular#^4.0.0 inside app directory to update the ionic info, this can be confirmed both via package.json and ionic info command

How to make Ionic 4 build for a browser?

I’m unfortunately having difficulty deploying my ionic project for web. No matter what I do, commands such as 'ionic build, ‘ionic build --prod’, ‘ng build --prod’, or whatsoever always create a www folder that is incorrect. The index.html in this www folder is always blank when viewed from a browser.
I’ve tested this issue on other ionic projects as well (just generated some from templates) and the same issue occurs here, with the index.html in the www folder always being displaying a blank site. If possible, I’d appreciate any help if that’s OK!
ionic cordova platform add browser
ionic cordova run browser
ionic cordova build browser --prod
For testing purpose use ionic serve . It will rebuild automatically every time when you update your code.
have you changed the base href in index.html from
base href="/"
to
base href="."

Replacing the IONIC's www folder makes no difference

It's been a while since I developed in ionic ( 1 yr ). I think things have changed.
I used to be able to create a new blank template ionic project at a local folder on the mac and then replace its placeholder www folder with another project's www folder. This used to work.
Now, replacing the www folder in that ionic blank project makes no difference when I run any of these commands
ionic serve
cordova build ios
cordova emulate ios
I keep seeing the "The world is your oyster" message.
In fact, when I even renamed the local folder that was holding the entire ionic project, the cordova build ios still has worked without any complaints.
Clearly, the code is running somewhere else.
I also notice this at the terminal prompt:
➜ vb git:(master)
Here the git:(master) thing is new to me. Could this be the culprit?
If so, how can I disassociate the github aspect so I can work on the local and quickly test the changes I will be making in the local www as easy as going cordova build ios?
The problem was that when I created the blank project, I used the defaults which now outputs an ionic 2 baby.
I did the following 2 changes to solve my problem.
create my app for version 1 by appending --type=ionic1 as follows:
ionic cordova start myapp -blank --type=ionic1
I also prefixed allmy cordova commands with ionic name space.
Now I can replace the www all day long and my ionic cordova build ios & ionic cordova emulate ios will comply.
hope it will help someone.

ionic cli - export project from 'Creator' not working

I've created a test project using ionic creator. I've created a blank page, assigned a title and added a button.
I save the project and I'd like to export the project
Ionic Creator - Using CLI
When I use the Ionic CLI tool with the command
ionic start [appName] creator:[MY_ID]
It tries to download my project from the following URL:
https://apps.ionic.io/api/v1/creator/[MY_ID]/download/html
This returns an empty zip file. So my project doesn't get initialised.
Ionic Creator - ZIP Export
The ZIP file link in creator is the following URL:
https://creator.ionic.io/api/v1/creator/[MY_ID]/download/html
This does return a ZIP with what I expect in.
I have successfully checked out a project using the CLI ~2 weeks ago and can't see what I'm doing differently. I'd be interested to know if anyone else is experiencing this problem?
I've tried putting the ZIP file contents into the WWW folder and initialising that way but to no avail.
CLI version is 1.7.1
OS is Windows 7
I have updated both the CLI and Cordova to the latest version.
Any ideas?
Note: I've raised this as a GitHub issue too - https://github.com/driftyco/ionic-cli/issues/619
I've upgraded from 1.7.1 to 1.7.6 today and it's now working.
It's using the following URL now -
https://creator.ionic.io/api/v1/creator/[ID]/download-start/cordova?sid=[SID]