久久久久久久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 正確清理項目?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時送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 任務(wù)存在一個大問題.如果我更改圖像,監(jiān)視任務(wù)會檢測到它并運行 images 任務(wù).這對 clean 任務(wù)也有依賴 (gulp.task('images', **['clean']**, function() {)),所以這個也運行.但是我的腳本文件丟失了,因為 scripts 任務(wù)沒有再次啟動,并且 clean 任務(wù)刪除了所有文件.

                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 任務(wù)并保留依賴項?

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

                推薦答案

                可以讓watch單獨觸發(fā)任務(wù):

                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']);
                

                這篇關(guān)于如何使用 gulp 正確清理項目?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                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 以使其以不同的方式運行任務(wù)?)
                Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                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日韩在线 | 成人av在线网站 | www.国产| 久久久久成人精品亚洲国产 | 国产精品久久久久久一区二区三区 | 日韩一区二区三区四区五区 | 久草免费福利 | 在线播放中文字幕 | 久久一起草 | 天天操夜夜看 | 91精品久久久久 | 五月婷婷丁香婷婷 | 欧美日韩第一页 | 欧美综合在线视频 | 亚洲另类视频 | 中文一区 | 国产亚洲精品a | 亚洲人人 | 久久国产一区二区三区 | 日本不卡高清视频 | 欧美精品一区二区三区在线 | 国产美女精品视频 | 亚洲五码久久 | 97高清国语自产拍 | 久久久久国产 | 99精品免费| 五月天综合网 | 国产欧美在线观看 | 欧美日韩亚洲视频 | 一级毛片免费视频观看 | 狠狠草视频 | 精品一级 | 国产精品视频一二三区 | 日韩欧美一区二区三区 | 免费人成激情视频在线观看冫 | 中文字幕日韩欧美一区二区三区 | 免费日韩av网站 | 久久精品99国产精品 | 国产精品久久久久久久久久 | 日韩亚洲欧美一区 | 国产日韩久久久久69影院 |