I’m using this tutorial to concat & minify my files.
The issue I’m running into is that I have to call
ionic serve
to rebuild my concat js file. I have have a before_prepare hook to run my gulp build (which it does) but it just creates all my files in the dist folder but doesn’t concatenate my js…just my css.
Everything works as expected if call
ionic serve
ionic run ios
but I always have to call serve first or my concat js file doesn’t get created. Any ideas on what I’m doing wrong? I’m following the tutorial to the letter…
I’ve seen that approach, but I wouldn’t do it that way because you’re spreading your build tasks between Gulp and Cordova. It’s easier and more transparent to just have Gulp do everything.
For anyone else trying to do this, the issue I was running into using that tutorial was the fact that gulp is asynchronous. Meaning the first time my tasks ran via my hook there were no files there to concat. Any time after that though, it always worked because the ng-annotate files were already there when my tasks kicked off.