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

    <bdo id='79Yqy'></bdo><ul id='79Yqy'></ul>

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

        <tfoot id='79Yqy'></tfoot>

      1. <small id='79Yqy'></small><noframes id='79Yqy'>

        使用 Gulp.js 和 globbing 模式就地修改文件(相同的目

        Modify file in place (same dest) using Gulp.js and a globbing pattern(使用 Gulp.js 和 globbing 模式就地修改文件(相同的目標))

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

      2. <legend id='JVAMG'><style id='JVAMG'><dir id='JVAMG'><q id='JVAMG'></q></dir></style></legend>

            <tbody id='JVAMG'></tbody>
          <i id='JVAMG'><tr id='JVAMG'><dt id='JVAMG'><q id='JVAMG'><span id='JVAMG'><b id='JVAMG'><form id='JVAMG'><ins id='JVAMG'></ins><ul id='JVAMG'></ul><sub id='JVAMG'></sub></form><legend id='JVAMG'></legend><bdo id='JVAMG'><pre id='JVAMG'><center id='JVAMG'></center></pre></bdo></b><th id='JVAMG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JVAMG'><tfoot id='JVAMG'></tfoot><dl id='JVAMG'><fieldset id='JVAMG'></fieldset></dl></div>
              • <tfoot id='JVAMG'></tfoot>
                  <bdo id='JVAMG'></bdo><ul id='JVAMG'></ul>
                  本文介紹了使用 Gulp.js 和 globbing 模式就地修改文件(相同的目標)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個 gulp 任務,它試圖將 .scss 文件轉換為 .css 文件(使用 gulp-ruby-sass),然后將生成的 .css 文件放到它找到原始文件的同一位置.問題是,由于我使用的是通配模式,我不一定知道原始文件的存儲位置.

                  I have a gulp task that is attempting to convert .scss files into .css files (using gulp-ruby-sass) and then place the resulting .css file into the same place it found the original file. The problem is, since I'm using a globbing pattern, I don't necessarily know where the original file is stored.

                  在下面的代碼中,我嘗試使用 gulp-tap 進入流并找出讀取流的當前文件的文件路徑:

                  In the code below I'm trying to use gulp-tap to tap into the stream and figure out the file path of the current file the stream was read from:

                  gulp.task('convertSass', function() {
                      var fileLocation = "";
                      gulp.src("sass/**/*.scss")
                          .pipe(sass())
                          .pipe(tap(function(file,t){
                              fileLocation = path.dirname(file.path);
                              console.log(fileLocation);
                          }))
                          .pipe(gulp.dest(fileLocation));
                  });
                  

                  根據 console.log(fileLocation) 的輸出,這段代碼看起來應該可以正常工作.但是,生成的 CSS 文件似乎比我預期的要高一個目錄.它應該是 project/sass/partials 的地方,結果文件路徑只是 project/partials.

                  Based on the output of the console.log(fileLocation), this code seems like it should work fine. However, the resulting CSS files seem to be placed one directory higher than I'm expecting. Where it should be project/sass/partials, the resulting file path is just project/partials.

                  如果有更簡單的方法可以做到這一點,我肯定會更加欣賞該解決方案.謝謝!

                  If there's a much simplier way of doing this, I would definitely appreciate that solution even more. Thanks!

                  推薦答案

                  正如你所懷疑的,你把這弄得太復雜了.目的地不需要是動態的,因為全局路徑也用于 dest.只需通過管道連接到您從中獲取 src 的同一基本目錄,在本例中為sass":

                  As you suspected, you are making this too complicated. The destination doesn't need to be dynamic as the globbed path is used for the dest as well. Simply pipe to the same base directory you're globbing the src from, in this case "sass":

                  gulp.src("sass/**/*.scss")
                    .pipe(sass())
                    .pipe(gulp.dest("sass"));
                  

                  如果您的文件沒有共同的基礎并且您需要傳遞一個路徑數組,那么這已經不夠了.在這種情況下,您需要指定基本選項.

                  If your files do not have a common base and you need to pass an array of paths, this is no longer sufficient. In this case, you'd want to specify the base option.

                  var paths = [
                    "sass/**/*.scss", 
                    "vendor/sass/**/*.scss"
                  ];
                  gulp.src(paths, {base: "./"})
                    .pipe(sass())
                    .pipe(gulp.dest("./"));
                  

                  這篇關于使用 Gulp.js 和 globbing 模式就地修改文件(相同的目標)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 任務)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)
                    • <bdo id='dKNUM'></bdo><ul id='dKNUM'></ul>
                        <legend id='dKNUM'><style id='dKNUM'><dir id='dKNUM'><q id='dKNUM'></q></dir></style></legend>

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

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

                            主站蜘蛛池模板: 日日夜夜精品视频 | 亚洲精品视频观看 | 久久精品国产一区二区三区不卡 | 日韩黄色av | 91精品国产乱码久久久久久 | h片免费在线观看 | 成人国产精品免费观看 | 一级片在线观看视频 | 国产亚洲欧美另类一区二区三区 | 羞羞视频在线观看免费观看 | 狠狠的日 | 国产日韩欧美在线播放 | 亚洲人精品午夜 | av在线天堂| 一区二区三区日韩 | 亚洲欧美激情国产综合久久久 | 国产传媒视频在线观看 | 国产激情偷乱视频一区二区三区 | 91视频大全 | 日本午夜精品一区二区三区 | 日韩中文字幕一区二区 | 午夜视频在线视频 | 亚洲成人高清 | 日韩一区二区免费视频 | 精品亚洲一区二区三区 | 人人玩人人添人人澡欧美 | 91在线精品视频 | 盗摄精品av一区二区三区 | 国产精品久久国产精品 | 成人综合在线视频 | 99国内精品久久久久久久 | av色站 | 日韩精品免费在线观看 | 国产精品久久久久无码av | 久久久无码精品亚洲日韩按摩 | 精品日韩一区二区 | av夜夜操| 欧美在线国产精品 | av一区二区三区四区 | 欧美亚洲激情 | 亚州精品天堂中文字幕 |