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

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

    1. <legend id='OIu50'><style id='OIu50'><dir id='OIu50'><q id='OIu50'></q></dir></style></legend>
        • <bdo id='OIu50'></bdo><ul id='OIu50'></ul>

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

        在 Gulp Stream 中獲取當(dāng)前文件名

        Get current file name in Gulp Stream(在 Gulp Stream 中獲取當(dāng)前文件名)
      1. <small id='XbWdj'></small><noframes id='XbWdj'>

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

                  <tbody id='XbWdj'></tbody>
                  <legend id='XbWdj'><style id='XbWdj'><dir id='XbWdj'><q id='XbWdj'></q></dir></style></legend>
                • 本文介紹了在 Gulp Stream 中獲取當(dāng)前文件名的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我已閱讀 獲取 gulp.src 中的當(dāng)前文件名(),它似乎正在接近我想要做的事情,但我需要幫助.

                  I've read Get the current file name in gulp.src(), and it seems like it's approaching what I am attempting to do, but I need help.

                  考慮 gulpfile.js 中的以下函數(shù):

                  Consider the following function in a gulpfile.js:

                  function inline() {
                    return gulp.src('dist/**/*.html')
                      .pipe($.if(PRODUCTION, inliner('dist/css/app.css')))
                      .pipe(gulp.dest('dist'));
                  }
                  

                  inliner(),要徹底(也在gulpfile中):

                  And inliner(), to be thorough (also in the gulpfile):

                  function inliner(css) {
                    var css = fs.readFileSync(css).toString();
                    var mqCss = siphon(css);
                  
                    var pipe = lazypipe()
                      .pipe($.inlineCss, {
                        applyStyleTags: false,
                        removeStyleTags: false,
                        removeLinkTags: false
                      })
                      .pipe($.replace, '<!-- <style> -->', `<style>${mqCss}</style>`);
                  
                    return pipe();
                  }
                  

                  這些函數(shù)采用外部 CSS 文件并將它們內(nèi)聯(lián)到相應(yīng)的電子郵件 HTML 中.

                  These functions take an external CSS file and inline them into the respective HTML for email.

                  真的想知道如何做這樣的事情:

                  I really want to know how to do something like this:

                  function inline() {
                    return gulp.src('dist/**/*.html')
                      .pipe($.if(PRODUCTION, inliner('dist/css/' + file.name + '.css')))
                      .pipe(gulp.dest('dist'));
                  }
                  

                  你可能會問自己,為什么?"好吧,我沒有一個 CSS 文件.如果要內(nèi)聯(lián) app.css 中的所有內(nèi)容,應(yīng)用的樣式將比實際需要的多得多.

                  And you might ask yourself, "why?" Well, I don't have just one CSS file. If everything from app.css was to be inlined, there would be a lot more styles applied than were actually necessary.

                  所以我想內(nèi)聯(lián):

                  email1.css    ----  to  ------->    email1.html
                  email2.css    ----  to  ------->    email2.html
                  email3.css    ----  to  ------->    email3.html
                  

                  等等.本質(zhì)上,我想在 Gulp Stream 中獲取當(dāng)時正在處理的 HTML 文件的名稱,將其保存為變量,然后將其傳遞給 inliner('dist/css/' + file.name +'.css') 位.我已經(jīng)用盡了我所有的 Gulp 知識,并且完全完全空白.

                  And so on. Essentially, I want to get the name of the HTML file being processed at that moment in the Gulp Stream, save it as a variable, and then pass it into the inliner('dist/css/' + file.name + '.css') bit. I've exhausted every bit of Gulp Knowledge I have and have come up completely and utterly blank.

                  推薦答案

                  基本上,您需要做的是將流中的每個 .html 文件發(fā)送到其自己的小子流中,并帶有自己的 內(nèi)聯(lián)().gulp-foreach 插件讓您做到這一點.

                  Basically what you need to do is send each .html file in your stream down its own little sub stream with its own inliner(). The gulp-foreach plugin let's you do just that.

                  然后,只需從文件的絕對路徑確定文件的簡單名稱即可.node.js 內(nèi)置 path.parse()讓你在那里.

                  Then it's just a matter of determining the simple name of your file from its absolute path. The node.js built-in path.parse() got you covered there.

                  把它們放在一起:

                  var path = require('path');
                  
                  function inline() {
                    return gulp.src('dist/**/*.html')
                      .pipe($.if(PRODUCTION, $.foreach(function(stream, file) {
                         var name = path.parse(file.path).name;
                         return stream.pipe(inliner('dist/css/' + name + '.css'));
                       })))
                      .pipe(gulp.dest('dist'));
                  }
                  

                  這篇關(guān)于在 Gulp Stream 中獲取當(dāng)前文件名的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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ù))
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  CSS3 Transition ( Vendor Prefixes) crashes Safari immediately(CSS3 過渡(供應(yīng)商前綴)立即使 Safari 崩潰)

                    • <legend id='k8VLs'><style id='k8VLs'><dir id='k8VLs'><q id='k8VLs'></q></dir></style></legend>
                    • <tfoot id='k8VLs'></tfoot>
                        <tbody id='k8VLs'></tbody>

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

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

                            主站蜘蛛池模板: 国产精品一区二区在线 | 91人人在线 | 欧美视频一区二区三区 | 国产精品网址 | 97精品国产一区二区三区 | 国产av毛片 | 在线亚洲欧美 | 亚洲精品av在线 | 国产福利视频 | 草草草影院 | 亚洲日韩中文字幕一区 | 九九热在线免费视频 | 成人欧美一区二区三区黑人孕妇 | 欧美日韩中文字幕在线 | 日韩毛片网 | 久久久久久国产精品免费免费狐狸 | 午夜一级黄色片 | 97国产一区二区 | 午夜男人的天堂 | 中文字幕精品一区二区三区精品 | 国产一区成人 | 亚洲bt 欧美bt 日本bt | 欧美国产亚洲一区二区 | 久久国产精品免费视频 | 国产成人精品一区二区三区视频 | 国产福利视频在线观看 | 精品人伦一区二区三区蜜桃网站 | 成人在线播放 | 欧美视频精品 | 久久精品一区二区三区四区 | 国产精品久久久久久久久久久久久久 | 亚洲视频自拍 | 欧美日韩久久 | 日韩视频精品 | 亚洲天堂二区 | 日韩视频在线免费观看 | 亚洲视频免费在线观看 | 欧美日韩精品久久久免费观看 | 视频一区在线 | 黄频免费| 在线一区二区三区 |