Going from top to bottom, first task is version, it just gets the package version from package.json file and outputs it to the console. I use this in Jenkins.
Next comes clean. It just removes build generated files, for next build to start from a clean slate.
Final three are watch, build, default. build is combo task that runs clean, lint, copy and compile. Notice that after clean everything ran in parallel because all those can be executed in parallel, so why not use those cors. watch watches my files for changes and it triggers a new build automatically every time I make a change to my code. default task (which is triggered when you run gulp without passing any task) builds the projects and watches for file changes. This way I just type gulp and I’m ready to work on my project knowing that everything is good and every time I make a change it automatically will build my code.
This is the build cycle for this type of projects. Artifact here can just be a zip file, you may just zip it up, and name with proper version and store somewhere. Deploy job will talk that zip with the right version, extract and upload to Ionic View, TestFlight, HockeyApp or whatever. Or just make it continuous and every time there is a commit upload the build.
Make sure to also check my other gulp files out: