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

<tfoot id='VbM0m'></tfoot>

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

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

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

      <legend id='VbM0m'><style id='VbM0m'><dir id='VbM0m'><q id='VbM0m'></q></dir></style></legend>
    1. 如何在 gulp 中創(chuàng)建重復(fù)管道?

      How to create repeating pipe in gulp?(如何在 gulp 中創(chuàng)建重復(fù)管道?)
    2. <small id='JxpW6'></small><noframes id='JxpW6'>

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

            <tbody id='JxpW6'></tbody>
          • <bdo id='JxpW6'></bdo><ul id='JxpW6'></ul>
          • <legend id='JxpW6'><style id='JxpW6'><dir id='JxpW6'><q id='JxpW6'></q></dir></style></legend>
              <tfoot id='JxpW6'></tfoot>
              1. 本文介紹了如何在 gulp 中創(chuàng)建重復(fù)管道?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                限時送ChatGPT賬號..

                我有一個 gulp 任務(wù)在 index.html 中注入幾個依賴項(xiàng):

                I have a gulp task to inject several dependencies in index.html as this :

                return gulp.src(config.serve.html)
                          .pipe($.inject(gulp.src(prependSource(config.inject.source.indexes)), {
                            read: false,
                            starttag: config.inject.indexes,
                            addRootSlash: false,
                            addPrefix: prefix,
                            ignorePath: ignore
                          }))
                          .pipe($.inject(gulp.src(managerList), {
                            read: false,
                            starttag: config.inject.managers,
                            addRootSlash: false,
                            addPrefix: prefix,
                            ignorePath: ignore
                          }))
                          .pipe($.inject(gulp.src(prependSource(config.inject.source.directives)), {
                            read: false,
                            starttag: config.inject.directives,
                            addRootSlash: false,
                            addPrefix: prefix,
                            ignorePath: ignore
                          }))
                
                          .pipe($.inject(gulp.src(prependSource(config.inject.source.routes)), {
                            read: false,
                            starttag: config.inject.routes,
                            addRootSlash: false,
                            addPrefix: prefix,
                            ignorePath: ignore
                          }))
                          .pipe($.inject(gulp.src(prependSource(config.inject.source.css)), {
                            read: false,
                            starttag: config.inject.css,
                            addRootSlash: false,
                            addPrefix: prefix,
                            ignorePath: ignore
                          }))
                
                
                          .pipe($.size())
                          .pipe(gulp.dest(dest));
                };
                

                如您所見,所有管道都以某種方式重復(fù)(managerList 除外).所以我想要的是在一系列注入的幫助下將重復(fù)管道合并到一個管道中.如何達(dá)到同樣的效果?

                As you can see, all the pipes are in repeating in some fashion (except the managerList). So what I want is to consolidate the repeating pipes into one single pipe, with the help of an array of injects. How to achieve the same?

                推薦答案

                gulp.src 返回一個流(每個 .pipe 也是如此).如果您考慮每個 .pipe 調(diào)用在做什么,您可以簡單地將其轉(zhuǎn)換為 for 循環(huán).像這樣的:

                gulp.src returns a stream (as does each .pipe). If you think about what each .pipe call is doing, you can simply turn it into a for loop. Something like this:

                config = { /* your config object */ };
                
                var stream = gulp.src(/* source glob */);
                for (var i = 0; i < injects.length; i++) {
                  stream = stream.pipe($.inject(gulp.src(prependSource(config.inject.source[i])), config.inject.starttag[i]));
                }
                
                stream.pipe($.size())
                      .pipe(gulp.dest(dest));
                
                return stream;
                

                這篇關(guān)于如何在 gulp 中創(chuàng)建重復(fù)管道?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 傳播運(yùn)算符上的意外令牌)
                Is it possible to pass a flag to Gulp to have it run tasks in different ways?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運(yùn)行任務(wù)?)
                Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運(yùn)行 Gulp 任務(wù))
                Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                  <tbody id='xSTVT'></tbody>

                <tfoot id='xSTVT'></tfoot>

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

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

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

                    • <bdo id='xSTVT'></bdo><ul id='xSTVT'></ul>
                        • 主站蜘蛛池模板: 啪啪网页 | 日韩成人av在线 | 91私密视频 | 精品在线一区二区 | 亚洲高清av在线 | 国产亚洲精品美女久久久久久久久久 | 国产精品成人一区二区三区夜夜夜 | 成人在线观看网站 | 日韩中文字幕 | 久久综合国产精品 | 精品久久不卡 | 九九免费观看视频 | 亚洲免费一区二区 | 国产成人精品免费视频大全最热 | 天天操天天干天天透 | 欧美日一区二区 | 天天爽夜夜爽精品视频婷婷 | 国产成人精品一区二 | 日产久久| 日本天天操 | 日韩精品一区二区三区 | 欧美久久不卡 | av日韩在线播放 | 激情一区| 综合色播 | 午夜丁香视频在线观看 | 日韩免费在线观看视频 | 亚洲成av | 国产精品区一区二区三 | 伊人久久综合 | 999久久久免费精品国产 | 精品一区二区三区四区 | 久久久片 | 黄网免费 | 久久精品一区二区三区四区 | 四虎最新地址 | 黄色综合 | 伊人久久一区二区 | 国产区在线免费观看 | 国产黄色网 | 中文字幕乱码一区二区三区 |