Mixing grunt and gulp

I used the grunt task runner in all angular projects in which I was involved.

Currently, I have found the gulp-protractor-qa plugin for gulp that tracks all my element selectors in on-the-fly tests. It’s good that he does, but now I have to have a separate config gulpfile.js for another build system (I cannot find a suitable alternative among the grunt plugins).

Can grunt and gulp build systems be used in the same project? What are the common actions in this case?


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

+6
source share
2 answers

As you said, if you have no other alternative with grunt , I think that the need to use both task runners is valid until an equivalent solution is found or created.

You should, of course, take care of the possible overrides and conflicts that arise with every task that you add to gulp , and for me, never mix your watchers . Always choose to use them for one reason or another for an endless loop. Even if in this case you are watching files with gulp-protractor-qa , there is no dependent task that starts and nothing is written, so you should be fine.

In addition, since the new dependencies will mainly be dev , the performance of your deployed application will be very slightly affected or not, unless you run your tests for each deployment, which may take a little longer to install them.

+4
source

There seems to be something wrong with running two build systems in the same frontend project. You have the ability to run grunt jobs from gulp ( https://www.npmjs.org/package/gulp-grunt ) or vice versa, gulp tasks from grunt ( https://www.npmjs.org/package/grunt-gulp ) . The first way looks more efficient, because gulp is much faster than grumbling. Go to the gulp as a whole; many grunt plugins have "native" gulp analogues.

If switching to gulp seems like an option, but you don't like the idea of ​​spending all this time overwriting the buil configuration for a new tool, try using some yoman-genereators. In particular, I would recommend using a bulky generator generator (npmjs.org/package/generator-boom). This is the best generator for angular with gulp to build out of the box on the table today.

+3
source

Source: https://habr.com/ru/post/973303/


All Articles