<tfoot id='kp3pC'></tfoot>
      • <bdo id='kp3pC'></bdo><ul id='kp3pC'></ul>

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

    2. <small id='kp3pC'></small><noframes id='kp3pC'>

      <legend id='kp3pC'><style id='kp3pC'><dir id='kp3pC'><q id='kp3pC'></q></dir></style></legend>

        如何防止 gulp-notify 在 Windows 中破坏 gulp-watch?

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

                <bdo id='j4m0p'></bdo><ul id='j4m0p'></ul>
                  <tbody id='j4m0p'></tbody>

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

                <tfoot id='j4m0p'></tfoot>

                  本文介绍了如何防止 gulp-notify 在 Windows 中破坏 gulp-watch?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在使用 gulp-notify 插件.这是我如何在 gulpfile.js 中实现它的一个例子(你可以看到我也在使用 gutil 和 livereload.我不知道它们是否发挥了任何作用,但如果它们发挥作用,请告诉我.)

                  I am using the gulp-notify plugin. This is an example of how I'm implementing it in a gulpfile.js ( You can see I'm using gutil and livereload as well. I don't know if they play any factors, but let me know if they do.)

                  gulp.task('js', function() {
                    return gulp.src('./dev/scripts/*.coffee')
                      .pipe(coffee({bare: true}).on('error', gutil.log))
                      .pipe( gulp.dest('./build/js'))
                      .pipe(notify('Coffeescript compile successful'))
                      .pipe(livereload(server));
                  });
                  

                  此插件适用于 OS X 和 Linux.在没有通知功能的 Windows 上,它会返回错误并破坏 gulp-watch 插件.这是我如何设置 gulp-watch 的示例:

                  This plugin works on OS X and Linux. On Windows, which doesn't have a notification feature, it returns an error and breaks the gulp-watch plugin. This is an example of how I have gulp-watch setup:

                  gulp.task('watch', function () {
                    server.listen(35729, function (err) {
                      if (err) {
                        return console.log(err);
                      }
                      gulp.watch('./dev/scripts/*.coffee',['js']);
                    });
                  });
                  

                  因此,我在文档中阅读了 gulp-pipe 插件可以帮助我在 Windows 上不破坏 gulp-watch,但我找不到如何在这样的设置中使用它的示例.

                  So, I read in the documentation the gulp-pipe plugin can help me not break gulp-watch when on Windows, but I can't find an example of how I could use it in a setup like this.

                  推荐答案

                  你可以使用 gulp-if插件结合os节点模块来确定您是否在 Windows 上,然后排除 gulp-notify,如下所示:

                  You can use the gulp-if plugin in combination with the os node module to determine if you are on Windows, then exclude gulp-notify, like so:

                  var _if = require('gulp-if');
                  
                  //...
                  
                  // From http://stackoverflow.com/questions/8683895/variable-to-detect-operating-system-in-node-scripts
                  var isWindows = /^win/.test(require('os').platform());
                  
                  //...
                  
                       // use like so:
                      .pipe(_if(!isWindows, notify('Coffeescript compile successful')))
                  

                  这篇关于如何防止 gulp-notify 在 Windows 中破坏 gulp-watch?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 GULP 编译 SASS 和 SUSY 下一篇:获取参数的 gulp 命令

                  相关文章

                  最新文章

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

                  <small id='IJu7I'></small><noframes id='IJu7I'>

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

                  1. <tfoot id='IJu7I'></tfoot>