久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='L3hPG'></tfoot>
    <i id='L3hPG'><tr id='L3hPG'><dt id='L3hPG'><q id='L3hPG'><span id='L3hPG'><b id='L3hPG'><form id='L3hPG'><ins id='L3hPG'></ins><ul id='L3hPG'></ul><sub id='L3hPG'></sub></form><legend id='L3hPG'></legend><bdo id='L3hPG'><pre id='L3hPG'><center id='L3hPG'></center></pre></bdo></b><th id='L3hPG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='L3hPG'><tfoot id='L3hPG'></tfoot><dl id='L3hPG'><fieldset id='L3hPG'></fieldset></dl></div>

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

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

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

        Gulp 錯誤:監視任務必須是一個函數

        Gulp error: watch task has to be a function(Gulp 錯誤:監視任務必須是一個函數)

          <tfoot id='JOKhc'></tfoot>
              <tbody id='JOKhc'></tbody>
            <legend id='JOKhc'><style id='JOKhc'><dir id='JOKhc'><q id='JOKhc'></q></dir></style></legend>
              <bdo id='JOKhc'></bdo><ul id='JOKhc'></ul>

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

                  <i id='JOKhc'><tr id='JOKhc'><dt id='JOKhc'><q id='JOKhc'><span id='JOKhc'><b id='JOKhc'><form id='JOKhc'><ins id='JOKhc'></ins><ul id='JOKhc'></ul><sub id='JOKhc'></sub></form><legend id='JOKhc'></legend><bdo id='JOKhc'><pre id='JOKhc'><center id='JOKhc'></center></pre></bdo></b><th id='JOKhc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JOKhc'><tfoot id='JOKhc'></tfoot><dl id='JOKhc'><fieldset id='JOKhc'></fieldset></dl></div>
                1. 本文介紹了Gulp 錯誤:監視任務必須是一個函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  這是我的 gulpfile:

                  Here is my gulpfile:

                  // Modules & Plugins
                  var gulp = require('gulp');
                  var concat = require('gulp-concat');
                  var myth = require('gulp-myth');
                  var uglify = require('gulp-uglify');
                  var jshint = require('gulp-jshint');
                  var imagemin = require('gulp-imagemin');
                  
                  // Styles Task
                  gulp.task('styles', function() {
                      return gulp.src('app/css/*.css')
                          .pipe(concat('all.css'))
                          .pipe(myth())
                          .pipe(gulp.dest('dist'));
                  });
                  
                  // Scripts Task
                  gulp.task('scripts', function() {
                      return gulp.src('app/js/*.js')
                          .pipe(jshint())
                          .pipe(jshint.reporter('default'))
                          .pipe(concat('all.js'))
                          .pipe(uglify())
                          .pipe(gulp.dest('dist'));
                  });
                  
                  // Images Task
                  gulp.task('images', function() {
                      return gulp.src('app/img/*')
                          .pipe(imagemin())
                          .pipe(gulp.dest('dist/img'));
                  });
                  
                  // Watch Task
                  gulp.task('watch', function() {
                      gulp.watch('app/css/*.css', 'styles');
                      gulp.watch('app/js/*.js', 'scripts');
                      gulp.watch('app/img/*', 'images');
                  });
                  
                  // Default Task
                  gulp.task('default', gulp.parallel('styles', 'scripts', 'images', 'watch'));
                  

                  如果我單獨運行 imagesscriptscss 任務,它就可以工作.我必須在任務中添加 return - 這不在書中,但谷歌搜索告訴我這是必需的.

                  If I run the images, scripts or css task alone it works. I had to add the return in the tasks - this wasn't in the book but googling showed me this was required.

                  我遇到的問題是 default 任務錯誤:

                  The problem I have is that the default task errors:

                  [18:41:59] Error: watching app/css/*.css: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)
                      at Gulp.watch (/media/sf_VM_Shared_Dev/webdevadvlocal/gulp/public_html/gulp-book/node_modules/gulp/index.js:28:11)
                      at /media/sf_VM_Shared_Dev/webdevadvlocal/gulp/public_html/gulp-book/gulpfile.js:36:10
                      at taskWrapper (/media/sf_VM_Shared_Dev/webdevadvlocal/gulp/public_html/gulp-book/node_modules/undertaker/lib/set-task.js:13:15)
                      at bound (domain.js:287:14)
                      at runBound (domain.js:300:12)
                      at asyncRunner (/media/sf_VM_Shared_Dev/webdevadvlocal/gulp/public_html/gulp-book/node_modules/async-done/index.js:36:18)
                      at nextTickCallbackWith0Args (node.js:419:9)
                      at process._tickCallback (node.js:348:13)
                      at Function.Module.runMain (module.js:444:11)
                      at startup (node.js:136:18)
                  

                  我認為是因為watch任務中也沒有return.錯誤信息也不清楚 - 至少對我來說.我嘗試在最后一個 gulp.watch() 之后添加一個 return 但這也不起作用.

                  I think it is because there is also no return in the watch task. Also the error message isn't clear - at least to me. I tried adding a return after the last gulp.watch() but that didn't work either.

                  推薦答案

                  在 gulp 3.x 中,您可以像這樣將任務的名稱傳遞給 gulp.watch():

                  In gulp 3.x you could just pass the name of a task to gulp.watch() like this:

                  gulp.task('watch', function() {
                    gulp.watch('app/css/*.css', ['styles']);
                    gulp.watch('app/js/*.js', ['scripts']);
                    gulp.watch('app/img/*', ['images']);
                  });
                  

                  在 gulp 4.x 中不再是這種情況.你必須傳遞一個函數.在 gulp 4.x 中執行此操作的習慣方法是只使用一個任務名稱傳遞 gulp.series() 調用.這會返回一個只執行指定任務的函數:

                  In gulp 4.x this is no longer the case. You have to pass a function. The customary way of doing this in gulp 4.x is to pass a gulp.series() invocation with only one task name. This returns a function that only executes the specified task:

                  gulp.task('watch', function() {
                    gulp.watch('app/css/*.css', gulp.series('styles'));
                    gulp.watch('app/js/*.js', gulp.series('scripts'));
                    gulp.watch('app/img/*', gulp.series('images'));
                  });
                  

                  這篇關于Gulp 錯誤:監視任務必須是一個函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運算符上的意外令牌)
                  Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標志傳遞給 Gulp 以使其以不同的方式運行任務?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                      <bdo id='p7hzr'></bdo><ul id='p7hzr'></ul>

                      <tfoot id='p7hzr'></tfoot>

                        <tbody id='p7hzr'></tbody>
                          • <legend id='p7hzr'><style id='p7hzr'><dir id='p7hzr'><q id='p7hzr'></q></dir></style></legend>

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

                            <i id='p7hzr'><tr id='p7hzr'><dt id='p7hzr'><q id='p7hzr'><span id='p7hzr'><b id='p7hzr'><form id='p7hzr'><ins id='p7hzr'></ins><ul id='p7hzr'></ul><sub id='p7hzr'></sub></form><legend id='p7hzr'></legend><bdo id='p7hzr'><pre id='p7hzr'><center id='p7hzr'></center></pre></bdo></b><th id='p7hzr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='p7hzr'><tfoot id='p7hzr'></tfoot><dl id='p7hzr'><fieldset id='p7hzr'></fieldset></dl></div>
                            主站蜘蛛池模板: 国产欧美日韩精品一区 | 福利一区二区在线 | 二区久久| 91久久| 成人福利片 | 亚洲成人午夜电影 | 91色视频在线| 亚洲综合首页 | 国产精品久久久久久久久久免费看 | 国产2区 | 日韩综合在线播放 | 精品久久99 | 欧美精品二区 | 观看毛片| 久久综合久久久 | 三极网站| 91xxx在线观看 | 亚洲最大av| 欧洲一级毛片 | 国产一区二区在线免费观看 | 亚洲一区二区免费 | 亚洲国产黄 | 日韩精品一区二区三区中文字幕 | 在线播放中文字幕 | www亚洲精品| 久久久久一区二区三区 | 可以免费看的毛片 | 蜜桃综合在线 | 毛片在线免费 | 97人人澡人人爽91综合色 | 亚洲在线免费观看 | 精品91av| 亚洲超碰在线观看 | 老妇激情毛片免费 | 欧美精品欧美精品系列 | 澳门永久av免费网站 | aaa大片免费观看 | 欧美视频在线一区 | 自拍 亚洲 欧美 老师 丝袜 | 欧美日韩一本 | 天堂网avav|