How can I tell Ionic (cordova) to find its sources in the yeoman's sources (app) dir?

How can I tell ionic to build from the yeoman’s “app” folder instead of default ionic “www”?

Ok, I think I found it. For those who at some point may want to work with yeo and ionic at the same time in the same project, and while a generator comes up that allows more comfortably to do this, I will share my findings…

Holly Schinsky, writes in her blog where the config files in a cordoba project are located for defining www as the source root, for both, Android and IOS.

http://devgirl.org/2012/10/04/cross-platform-phonegap-aka-cordova-project-templates-in-a-jiffy/

However, running a find in the cordova platforms folder gave me this:

which makes me think that I don’t want to mess with these values, as they may be regenerated at some point, also I know it is a very bad practice to write into auto-generated files. sooooo…

Probably the best solution is just to edit the grunt file and set the dist folder as “www”, run “grunt build” and then use "ionic build " and "ionic emulate ", it takes its time, but probably for the moment is good enough.

If anyone knows a better solution please let me know, in the meantime I hope this may help others with the same issue.

Hey there!

I’ve created a Yeoman generator for Ionic that attempts to support developing Ionic apps with an intelligent workflow and powerful build system.

There is a grunt build command that handles doing something very similar to what you described. It takes the assets from the app/ folder concatenates, obfuscates, and minifies everything, then copies the resulting files to the www/ directory before finally running the wrapped cordova build command.

I’m hoping the community finds it useful - https://github.com/diegonetto/generator-ionic

1 Like

That sounds amazing! I am going to start a new project next week, I will check it out definitely.

Thanks!