Open amolghotankar opened 9 years ago
Hmmm. That's interesting. I've been wanting to look into only building changed files during the watch phase, but I hadn't considered during a build/deploy phase.
Are you all using gulp build --stage=prod
to build minified assets? I think we'd have to build all files again just to make sure the minified assets are good.
This is definitely an interesting idea.
Yes I agree in production it has to build all new files and deployed afresh.
But in local dev where people like me need to use angularjs with existing application fronted using IIS, apache or something. We typically would be very happy of we get this feature developed.
There are some scenarios where we cannot avoid IIS/Apache fronting typically when you have having a MS Sharepoint provider hosted app developing using AngularJs frontend.
My Idea was if we have a command some like gulp build --watch which will watch for changes in any file and update the build folder with the changed file.
I remember this is pretty hard task in practice because nodejs watch is not very robust back then. Maybe the situation change and I feel like ng-poly structure is pretty clean and straightforward to achieve it.
I've been looking into https://github.com/contra/gulp-cached and https://github.com/ahaurw01/gulp-remember. I think we can manage this functionality when in dev stage. I'll experiment with this in the next few weekends.
Another issue with this is when you do syntax error in JS source file (forgot one bracket for example) then started gulp
watching just interrupts. And after correcting the mistake you must run gulp
again and each this cold start takes 30sec-3min. If we can do partial build each time then maybe this will be faster.
But another option is to not interrupt watch after mistake in JS syntax. I don't know if it possible.
When using ng-poly for the extreme large project, everytime gulp build command clean everything and builds everything. It is overall a good thing but lets say we have changed only one file then it does not update that only one file.
It would be good if we have option with gulp build -onlyChanges which will not clean everything but just update changed files.
Not sure if this is too much.
Note- We are not using plain gulp to run it in browser, but using gulp build and build folder that gets generated is used by Apache.