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

  • <small id='jnReu'></small><noframes id='jnReu'>

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

    <tfoot id='jnReu'></tfoot>

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

        <legend id='jnReu'><style id='jnReu'><dir id='jnReu'><q id='jnReu'></q></dir></style></legend>
      2. 在 Gulp 中使用變量作為目標文件名?

        Using variables in Gulp for the destination file name?(在 Gulp 中使用變量作為目標文件名?)
          <i id='orTPo'><tr id='orTPo'><dt id='orTPo'><q id='orTPo'><span id='orTPo'><b id='orTPo'><form id='orTPo'><ins id='orTPo'></ins><ul id='orTPo'></ul><sub id='orTPo'></sub></form><legend id='orTPo'></legend><bdo id='orTPo'><pre id='orTPo'><center id='orTPo'></center></pre></bdo></b><th id='orTPo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='orTPo'><tfoot id='orTPo'></tfoot><dl id='orTPo'><fieldset id='orTPo'></fieldset></dl></div>
          <legend id='orTPo'><style id='orTPo'><dir id='orTPo'><q id='orTPo'></q></dir></style></legend>

            <tbody id='orTPo'></tbody>
          <tfoot id='orTPo'></tfoot>

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

          • <bdo id='orTPo'></bdo><ul id='orTPo'></ul>
                  本文介紹了在 Gulp 中使用變量作為目標文件名?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我是 gulp 的新手,我想知道我想要實現的目標是實際的還是可能的.

                  I am new to gulp and I am wondering if what I want to achieve is practical or possible.

                  我的項目結構:

                  root
                  |
                  components
                  |   |
                  |   component_1
                  |   |   styles.scss
                  |   |   actions.js
                  |   |   template.html
                  |   |   ...
                  |   component_2
                  |   |   styles.scss
                  |   |   template.html
                  |   |   ...
                  |
                  public
                      |
                      assets
                           |
                           css (dest)
                           |    component_1.css
                           |    component_2.css
                           |    ...
                           js (dest)
                  

                  現在我想要的是 Gulp 將編譯后的 css 文件存儲在 public/assets 的相應 css 文件夾中,但使用它找到 scss 文件的文件夾的名稱.那可能嗎?我需要將它傳送到插件嗎?謝謝!PS我確實意識到我可以通過重命名scss來實現這一點,但這是我想避免的.

                  Now what I want is that Gulp stores the compiled css files in the according css folder in public/assets but uses the name of folder where it found the scss file. Is that possible? Do I need to pipe that to a plugin? Thanks! PS i do realize I could achieve that by just renaming the scss, but that's what I'd like to avoid.

                  推薦答案

                  這不會太難,這取決于你需要多少動態.Gulp 是純 JS,因此您可以非常輕松地編寫自己的函數.您可以使用 gulp-rename 插件 重命名部分或全部文件名保存之前.

                  It wouldn't be too hard, depending on how much you need it to be dynamic. Gulp is pure JS, so you can very easily write your own functions. you can use the gulp-rename plugin to rename part or all of the file name before saving.

                  這里有一個粗略的想法可以幫助您入門:

                  Here's a rough idea to get you started:

                  var rename = require('gulp-rename'),
                      path = require('path'),
                      glob = require('glob'); // npm i --save-dev glob    
                  
                  var components = glob.sync('components/*').map(function(componentDir) {
                          return path.basename(componentDir);
                      });
                  
                  components.forEach(function(name) {
                      gulp.task(name+'-style', function() {
                          return gulp.src('components/'+name+'/styles.scss')
                              .pipe(sass()) // etc
                              .pipe(rename(name + '.css'))
                              .pipe(gulp.dest('public/assets/css'))
                      });
                  
                      gulp.task(name+'-js', function() {
                          // similar idea for JS files
                      });
                  
                      gulp.task(name+'-build', [name+'-style', name+'-js']);
                  });
                  
                  // build all components
                  gulp.task('build-components', components.map(function(name){ return name+'-build'; }));
                  

                  現在您將為每個組件創建名為 component_1-buildcomponent_1-stylecomponent_1-js 等的任務.

                  Now you'll have tasks named component_1-build, component_1-style, component_1-js, etc, for each component.

                  您還有一個可以構建所有組件的任務.

                  You also have a task that can build all components.

                  這篇關于在 Gulp 中使用變量作為目標文件名?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 任務)
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)

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

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

                              <tbody id='DOte0'></tbody>

                            主站蜘蛛池模板: 91麻豆精品国产91久久久久久久久 | 黄色一级片aaa | 欧美日韩三区 | 91影片| 国产专区在线 | 99影视 | 亚洲一区| 高清国产午夜精品久久久久久 | 最近日韩中文字幕 | 亚洲午夜精品 | 中文字幕在线观看第一页 | 91九色porny首页最多播放 | 国外成人在线视频 | 搞av.com| 国产欧美精品一区二区三区 | 欧美日韩中文在线观看 | 超碰导航 | 欧美寡妇偷汉性猛交 | 日韩欧美在线观看视频网站 | 中文精品视频 | 欧美自拍另类 | 日韩h| 午夜免费视频 | 欧美成人影院在线 | 91视视频在线观看入口直接观看 | 亚洲成人精品免费 | 日韩av福利在线观看 | 免费观看日韩av | 中文字幕在线播放第一页 | 日本高清视频在线播放 | 奇米四色在线观看 | 国产高清精品网站 | gav成人免费播放视频 | 在线看无码的免费网站 | 天天射美女 | 精品国产伦一区二区三区观看说明 | 在线一区视频 | 国产视频精品免费 | 美女福利视频一区 | 夜夜骑首页| 国产福利视频导航 |