Improve the Ionic App Base template

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, 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.

1 Like

There is some discussion on this on another thread:

It appears from the response of Ionic team members that this is a priority for them in the final release.

Oh, interesting. Thanks for making me aware of that.

I’d be happy to contribute, as we have a working solution for this task, based on the Ionic framework. If there’s any interest in our work, I’d appreciate a ping :slight_smile: