After working with our app, which was built from the starter project with the Ionic CLI, I’ve recently worked on resolving the problems we had with it and I wanted to share some thoughts.
In my humble opinion, https://github.com/driftyco/ionic-app-base has some issues and opens new users up to creating sub-optimal output.
The major reason for this is that www
is used as the development root. www
is the directory that will be wrapped up into the application which you deploy and distribute. Thus, you would want to keep is as slim and clean as possible. This is not possible if you put all your development data (and dependencies) into it.
I understand that this is a template and that it’s up to the user to adjust it to their needs, but I don’t see why this behavior shouldn’t be avoided right from the start.
The alternative I propose is moving the user code to a different location, say src
and putting dependencies into their default location bower_components
. Then use gulp to “compile” the project into www
before invoking cordova
to build and/or deploy the app.
This has the added benefit of easily being able to include minification and, thus, reduce the size of the resulting application package. From what I can tell, this is very hard to implement with the current project structure.
I’d love to hear some thoughts on this.