S
S
s_a_iii_a2020-10-13 11:20:21
npm
s_a_iii_a, 2020-10-13 11:20:21

Which is more efficient: npm script VS gulp task?

The question is actually going to be a bit broader.

At some point, I realized that tasks in npm and gulp are not the same thing, that layout automation can be done using both npm and gulp tools.

That is, in package.json in the "scripts" section, you can write something like this: And in gulpfile.js:
"build-css": "cat static/pages/*.css tabs/*/*.css"

gulp.task('styles', function() {  
    gulp.src(['css/**/*.css'])
        .pipe(styl({compress : true}))
        .pipe(gulp.dest('build'))
        .pipe(refresh(server))
});


And in both cases, the work will occur with styles

. Questions, the answers to which will clarify for me:
  1. When is it preferable to use npm scripts, and in which gulp tasks?
  2. Where is the performance, execution speed is higher?
  3. Where is the flexibility the most?
  4. Since gulp appeared later, why else are they limited to one npm for layout automation


Having written the questions above, I feel that they did not cover all my interest, that the answers to them will not completely rid my understanding of white spots. Therefore, you can supplement your answers with the topic of the relationship between npm and gulp between themselves.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2020-10-13
@delphinpro

Do not confuse green with soft.
Package manager and task runner.
They have completely different purposes. And the fact that you can write a command to call any script in package.json does not make them similar at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question