• <legend id='G1Dfa'><style id='G1Dfa'><dir id='G1Dfa'><q id='G1Dfa'></q></dir></style></legend>
    <i id='G1Dfa'><tr id='G1Dfa'><dt id='G1Dfa'><q id='G1Dfa'><span id='G1Dfa'><b id='G1Dfa'><form id='G1Dfa'><ins id='G1Dfa'></ins><ul id='G1Dfa'></ul><sub id='G1Dfa'></sub></form><legend id='G1Dfa'></legend><bdo id='G1Dfa'><pre id='G1Dfa'><center id='G1Dfa'></center></pre></bdo></b><th id='G1Dfa'></th></span></q></dt></tr></i><div id='G1Dfa'><tfoot id='G1Dfa'></tfoot><dl id='G1Dfa'><fieldset id='G1Dfa'></fieldset></dl></div>
  • <small id='G1Dfa'></small><noframes id='G1Dfa'>

          <bdo id='G1Dfa'></bdo><ul id='G1Dfa'></ul>

      1. <tfoot id='G1Dfa'></tfoot>
      2. 如何强制 gulp 调用同步运行?

        时间:2023-05-29
        1. <small id='YMcuB'></small><noframes id='YMcuB'>

          • <legend id='YMcuB'><style id='YMcuB'><dir id='YMcuB'><q id='YMcuB'></q></dir></style></legend>

            <tfoot id='YMcuB'></tfoot>
              <tbody id='YMcuB'></tbody>

              <bdo id='YMcuB'></bdo><ul id='YMcuB'></ul>

                <i id='YMcuB'><tr id='YMcuB'><dt id='YMcuB'><q id='YMcuB'><span id='YMcuB'><b id='YMcuB'><form id='YMcuB'><ins id='YMcuB'></ins><ul id='YMcuB'></ul><sub id='YMcuB'></sub></form><legend id='YMcuB'></legend><bdo id='YMcuB'><pre id='YMcuB'><center id='YMcuB'></center></pre></bdo></b><th id='YMcuB'></th></span></q></dt></tr></i><div id='YMcuB'><tfoot id='YMcuB'></tfoot><dl id='YMcuB'><fieldset id='YMcuB'></fieldset></dl></div>
                  本文介绍了如何强制 gulp 调用同步运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我希望下面的 gulp 调用一个接一个地同步运行.但他们不服从命令.

                  I want the gulp calls below to run synchronously, one after the other. But they do not follow an order.

                  run-sequence 节点模块在这里没有帮助,因为我不想运行 gulp串联任务(即,它的语法类似于 gulp.task("mytask", ["foo", "bar", "baz"] 等),而是串联 gulp 调用",如下所示.

                  The run-sequence node module doesn't help here, as I'm not trying to run gulp tasks in series (i.e. it has syntax similar to gulp.task("mytask", ["foo", "bar", "baz"] etc.), but rather gulp "calls" in series, as you see below.

                  gulp.task("dostuff", function (callback) {
                  
                    gulp
                      .src("...")
                      .pipe(gulp.dest("...");
                  
                    gulp
                      .src("...")
                      .pipe(gulp.dest("...");
                  
                    gulp
                      .src("...")
                      .pipe(gulp.dest("...");
                  
                    callback();
                  });
                  

                  如何让它们一个接一个地运行?

                  How do I make them run one after the other?

                  推荐答案

                  你可以使用async 作为您的呼叫的控制流程,让他们只完成一项任务,同时避免您获得金字塔效应".所以这样的事情应该对你的用例有好处:

                  You can use async as a control flow for your calls to get them in only one task, also avoiding you to get a "pyramid effect". So something like this should be good for your use-case:

                  var async = require('async');
                  
                  gulp.task('yeah', function (cb) {
                    async.series([
                      function (next) {
                        gulp.src('...')
                          .pipe(gulp.dest('...')
                          .on('end', next);
                      },
                      function (next) {
                        gulp.src('...')
                          .pipe(gulp.dest('...')
                          .on('end', next);
                      },
                      function (next) {
                        gulp.src('...')
                          .pipe(gulp.dest('...')
                          .on('end', next);
                      }
                    ], cb);
                  });
                  

                  这也将允许您进行一些错误处理并更好地定位发生问题的位置.

                  That will also allow you to have some error handling and target better where a problem occured.

                  这篇关于如何强制 gulp 调用同步运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Node.js - 开发中的自动刷新 下一篇:Gulp.js,保存文件时监视任务运行两次

                  相关文章

                  最新文章

                • <small id='4ZP3R'></small><noframes id='4ZP3R'>

                  1. <i id='4ZP3R'><tr id='4ZP3R'><dt id='4ZP3R'><q id='4ZP3R'><span id='4ZP3R'><b id='4ZP3R'><form id='4ZP3R'><ins id='4ZP3R'></ins><ul id='4ZP3R'></ul><sub id='4ZP3R'></sub></form><legend id='4ZP3R'></legend><bdo id='4ZP3R'><pre id='4ZP3R'><center id='4ZP3R'></center></pre></bdo></b><th id='4ZP3R'></th></span></q></dt></tr></i><div id='4ZP3R'><tfoot id='4ZP3R'></tfoot><dl id='4ZP3R'><fieldset id='4ZP3R'></fieldset></dl></div>
                    <tfoot id='4ZP3R'></tfoot>

                      <bdo id='4ZP3R'></bdo><ul id='4ZP3R'></ul>
                      <legend id='4ZP3R'><style id='4ZP3R'><dir id='4ZP3R'><q id='4ZP3R'></q></dir></style></legend>