Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mixing grunt and gulp

I've been using grunt task runner in all of the angular projects I was involved in.

Currently, I found a gulp-protractor-qa plugin for gulp that watches all my element selectors in the tests on the fly. It is good at what it does, but now I have to have a separate gulpfile.js config for the another build system (I cannot find an appropriate alternative among grunt plugins).

Is it okay to use both grunt and gulp build systems in a single project? What are the generally accepted actions in this case?


gulp-protractor-qa is just an example. I can imagine this would hit me again when I would need different suitable plugins in both build systems and would have to make a choice: try to sit on two chairs?

like image 480
alecxe Avatar asked Aug 04 '14 07:08

alecxe


People also ask

Should I use Grunt or Gulp?

Gulp vs Grunt: Speed The reason for Gulp's current speed advantage is down to the fact that Gulp uses streams and handles tasks in memory, which means that only one file is written. Furthermore, Gulp can process several tasks at the same time, but Grunt will normally only handle one task at a time.

What is Gulp and Grunt used for?

gulp and Grunt are task runners. They are different approaches to same problem. Grunt uses configuration based approach, while gulp uses streams from node to achieve result. You use them to define how and which tasks to execute (copying files, adding banners, replacing text, style checking, etc...).

Is Grunt still used?

So task runners like Grunt and Gulp still have their place and we still use both here at Delicious Brains as build tools for different products we develop.

What is Grunt used for?

Grunt is a JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. It uses a command-line interface to run custom tasks defined in a file (known as a Gruntfile). Grunt was created by Ben Alman and is written in Node. js.


1 Answers

Like you said, if you don't have any other alternative with grunt, I think that the need of using both task runners is real until an equivalent solution is found or created.

You should of course take care of the possible overrides and conflicts that comes with each task you add in gulp, and to me, never mix your watchers. Always choose to use them in one or the other runner cause of the infinite loops. Even if in this case with gulp-protractor-qa you are watching files, there is no dependent task which runs and nothing is written so you should be fine.

Also, since the new dependencies will mainly be the dev ones, the performance of your deployed app will be very slightly affected or not, except if you run your tests on each deploy, that may take a little longer to install them.

like image 85
Preview Avatar answered Sep 28 '22 03:09

Preview