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

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

  1. <small id='Apx7L'></small><noframes id='Apx7L'>

  2. <tfoot id='Apx7L'></tfoot>

      • <bdo id='Apx7L'></bdo><ul id='Apx7L'></ul>

      如何使用 gulp 正確清理項目?

      How to clean a project correctly with gulp?(如何使用 gulp 正確清理項目?)

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

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

                  <tbody id='flWeh'></tbody>

              1. <tfoot id='flWeh'></tfoot>
                本文介紹了如何使用 gulp 正確清理項目?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                在 gulp 頁面上有以下示例:

                gulp.task('clean', function(cb) {
                  // You can use multiple globbing patterns as you would with `gulp.src`
                  del(['build'], cb);
                });
                
                gulp.task('scripts', ['clean'], function() {
                  // Minify and copy all JavaScript (except vendor scripts)
                  return gulp.src(paths.scripts)
                    .pipe(coffee())
                    .pipe(uglify())
                    .pipe(concat('all.min.js'))
                    .pipe(gulp.dest('build/js'));
                });
                
                // Copy all static images
                gulp.task('images', ['clean'], function() {
                 return gulp.src(paths.images)
                    // Pass in options to the task
                    .pipe(imagemin({optimizationLevel: 5}))
                    .pipe(gulp.dest('build/img'));
                });
                
                // the task when a file changes
                gulp.task('watch', function() {
                  gulp.watch(paths.scripts, ['scripts']);
                  gulp.watch(paths.images, ['images']);
                });
                
                // The default task (called when you run `gulp` from cli)
                gulp.task('default', ['watch', 'scripts', 'images']);
                

                這很好用.但是 watch 任務存在一個大問題.如果我更改圖像,監視任務會檢測到它并運行 images 任務.這對 clean 任務也有依賴 (gulp.task('images', **['clean']**, function() {)),所以這個也運行.但是我的腳本文件丟失了,因為 scripts 任務沒有再次啟動,并且 clean 任務刪除了所有文件.

                This works quite well. But there is one big problem with the watch task. If I change an image, the watch task detect it and runs the images task. This also has a dependency (gulp.task('images', **['clean']**, function() {) on the clean task, so this runs also. But than my script files are missing because the scripts task did not start again and the clean task deleted all files.

                如何在第一次啟動時運行 clean 任務并保留依賴項?

                How can I just run the clean task on the first startup and keep the dependencies?

                推薦答案

                可以讓watch單獨觸發任務:

                gulp.task('clean', function(cb) {
                  // You can use multiple globbing patterns as you would with `gulp.src`
                  del(['build'], cb);
                });
                
                var scripts = function() {
                  // Minify and copy all JavaScript (except vendor scripts)
                  return gulp.src(paths.scripts)
                    .pipe(coffee())
                    .pipe(uglify())
                    .pipe(concat('all.min.js'))
                    .pipe(gulp.dest('build/js'));
                };
                gulp.task('scripts', ['clean'], scripts);
                gulp.task('scripts-watch', scripts);
                
                // Copy all static images
                var images = function() {
                 return gulp.src(paths.images)
                    // Pass in options to the task
                    .pipe(imagemin({optimizationLevel: 5}))
                    .pipe(gulp.dest('build/img'));
                };
                gulp.task('images', ['clean'], images);
                gulp.task('images-watch', images);
                
                // the task when a file changes
                gulp.task('watch', function() {
                  gulp.watch(paths.scripts, ['scripts-watch']);
                  gulp.watch(paths.images, ['images-watch']);
                });
                
                // The default task (called when you run `gulp` from cli)
                gulp.task('default', ['watch', 'scripts', '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='Wrx3h'></bdo><ul id='Wrx3h'></ul>

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

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

                        <tbody id='Wrx3h'></tbody>
                      <tfoot id='Wrx3h'></tfoot>
                        1. <legend id='Wrx3h'><style id='Wrx3h'><dir id='Wrx3h'><q id='Wrx3h'></q></dir></style></legend>

                          主站蜘蛛池模板: 久久久久国产一级毛片高清网站 | 久久中文字幕一区 | 精品久久久久久久久久久久久久 | 欧美成人免费在线视频 | 国产高清视频在线观看播放 | 玖玖精品| 日本精品一区二区在线观看 | 亚洲精品小视频在线观看 | 老头搡老女人毛片视频在线看 | 国产亚洲精品美女久久久久久久久久 | 好姑娘影视在线观看高清 | 91亚洲精品国偷拍自产在线观看 | 日韩在线成人 | 91精品国产91久久久久福利 | 国产精品不卡一区 | 久久一及片 | av在线免费观看网址 | 免费一区二区三区 | 99精品福利视频 | 国产精品久久久久久久免费大片 | 亚洲视频免费在线播放 | 99久久精品视频免费 | 日韩av在线中文字幕 | 狠狠综合久久av一区二区老牛 | 一区二区中文 | 一级在线| 欧美日韩精品一区二区三区视频 | 毛片免费看的 | 99久久99热这里只有精品 | 鸡毛片| 久久爱综合 | 黄色永久免费 | 欧美日韩在线视频观看 | 亚洲国产欧美在线 | 日韩精品在线网站 | 一区观看 | 国产一区二区三区四区 | 精品在线观看一区二区 | 在线色网| 可以免费观看的av片 | 亚洲精品在线看 |