Two index.html: What are their purposes?


#1

I am currently using ionic 3.4.0 to build an app. I have done “npm install -g cordova ionic” and have not touched anything else other than the home.html page in the pages folder (I added a button to try fiddling with some styling). I don’t imagine that would interfere with anything.

My question is: after I downloaded everything I got two index.htmls, one in src folder and another in www folder. What are their purposes? It seems confusing, but I could be easily missing something. Anything helps! Thanks in advance!
Below is a snapshot of what it looks like on my computer (I use Visual Code Studio


#2

src is where you modify things. www is the build directory that can be deployed to a web server if you wish.


#3

Thank you for the comment. I’m interested in this type of informations too. Can you link a page where it’s explained the folder structure of Ionic 2? (or explain by yourself if you are up to).
I just found http://ionicframework.com/docs/v1/concepts/structure.html (v1) where “WWW is where your app is developed and where you’ll spend most of your time when building an Ionic app”.
I’m assuming that with v2 something changed so during developing i haven’t to modify the www folder?

A question: After creating a new blank app, I saw in app.components.Ts rootPage:any = HomePage; so the start page is the home.html. Then what is the real utility of having also index.html?


#4

Thank you, that helps!


#5

index.html is the page being loaded. Everyone knows what it is called, so webserver deliver it by default and native platforms via Cordova have it set as the starting point. In there the real application gets loaded via JS code. Inside the application you can do whatever you want - HomePage, LalaPage, FooPage, or something totally different. If you look into the other starters, you will see that it is not alway HomePage.