Search code examples
gulpgruntjs

Is it possible to run grunt in project that use gulp?


Currently I'm working in project that using gulp, but for some reason in my machine is little bit slow, so the question is can I use grunt in project that use gulp?


Solution

  • can I use grunt in project that use gulp?
    

    Of course you can, but you will duplicate all the preprocessing modules(one for gulp and one for grunt) and the build configuration/logic hence adding additional complexity. Yuck.

    but for some reason in my machine is little bit slow
    

    gulp is faster - in theory - since it does it's processing in-memory rather than doing heavy I/O by writing to temp. files which is what grunt does. The task runner is - most probably - not the cause of your problems.

    gulp/grunt are just task runners - the modules themselves and the way they are configured are causing the slowdown, not the task runner that runs them.

    You are - most likely

    • watching/preprocessing files that you don't need to.
    • performing production-readiness tasks far too often.
      • You might have a module that compresses all the images which you run every time a file changes. Put those heavy tasks into a task run that is run just just once before you push into production
      • ES6 -> ES5 transpilation? That's usually heavy. Keep this into a just-before-production task as well

    Optimise what you have, especially if it's not your project.