久久久久久久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 的新手,我想知道我想要實現(xiàn)的目標是實際的還是可能的.

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

                  我的項目結(jié)構(gòu):

                  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)
                  

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

                  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.

                  推薦答案

                  這不會太難,這取決于你需要多少動態(tài).Gulp 是純 JS,因此您可以非常輕松地編寫自己的函數(shù).您可以使用 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'; }));
                  

                  現(xiàn)在您將為每個組件創(chuàng)建名為 component_1-buildcomponent_1-stylecomponent_1-js 等的任務(wù).

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

                  您還有一個可以構(gòu)建所有組件的任務(wù).

                  You also have a task that can build all components.

                  這篇關(guān)于在 Gulp 中使用變量作為目標文件名?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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ù))
                  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>

                            主站蜘蛛池模板: 超碰麻豆| 欧美日韩成人一区二区三区 | 日韩一区二区视频 | 亚洲一区成人 | 一区视频| 国产吃瓜黑料一区二区 | 中文字幕在线观看免费 | 自拍偷拍欧美日韩 | 伦一理一级一a一片 | 欧美久久久久久久久 | 9.1成人看片免费版 999在线视频 | 香蕉视频在线免费看 | 国产精品一级二级 | 天天干视频 | 4hu在线| 欧美专区在线 | aaa级片| 特黄一级视频 | 欧美黄色三级视频 | 日韩不卡免费视频 | 精品久久精品 | 欧美激情久久久 | 欧美在线视频一区二区 | 黄色av免费| 亚洲欧美国产高清va在线播放 | 日韩精品一区二区三区免费视频 | 视频一区在线观看 | 国产成人精品一区二区三区福利 | 放几个免费的毛片出来看 | 午夜在线影院 | 天天射天天爽 | 欧美三级 欧美一级 | 亚洲色综合 | 日韩在线不卡 | 久久av资源| 这里只有精品视频在线观看 | 99热伊人 | 97国产视频 | 久久瑟瑟 | 天天久久 | 国产精品欧美在线 |