久久久久久久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 任務(wù),它試圖將 .scss 文件轉(zhuǎn)換為 .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));
                  });
                  

                  根據(jù) console.log(fileLocation) 的輸出,這段代碼看起來應(yīng)該可以正常工作.但是,生成的 CSS 文件似乎比我預期的要高一個目錄.它應(yīng)該是 project/sass/partials 的地方,結(jié)果文件路徑只是 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!

                  推薦答案

                  正如你所懷疑的,你把這弄得太復雜了.目的地不需要是動態(tài)的,因為全局路徑也用于 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"));
                  

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

                  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("./"));
                  

                  這篇關(guān)于使用 Gulp.js 和 globbing 模式就地修改文件(相同的目標)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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ù))
                  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>

                            主站蜘蛛池模板: 欧美一二精品 | 91久久国产综合久久 | 欧美日韩综合视频 | 亚洲视频中文字幕 | 国产精品黄 | 亚洲三级在线观看 | 国产一区二区中文字幕 | 四虎影院欧美 | 亚洲久久久 | 久久久久久久久淑女av国产精品 | 国产日韩欧美在线观看 | 久久精品国产一区二区电影 | 超碰在线免费av | 国产日韩欧美在线观看 | www.99re| 亚洲毛片一区二区 | 亚洲社区在线 | 一区二区三区欧美大片 | 久久久久久av | 久久中文视频 | 情侣酒店偷拍一区二区在线播放 | 国产精品大片在线观看 | 成人在线影视 | 伊人伊成久久人综合网站 | 久久一区二区视频 | 久久神马| 欧美一区二区三区在线观看 | 国产成人精品午夜 | 国产高清视频在线观看 | 日本在线视频中文字幕 | 久久免费观看一级毛片 | 涩涩视频在线观看免费 | 亚洲欧美一区二区三区国产精品 | 久久国产精品视频观看 | 精品一区二区在线看 | 国产精品欧美一区二区三区不卡 | 午夜91| 999视频在线播放 | 中文字幕韩在线第一页 | 久久久精 | 日韩精品久久久久 |