久久久久久久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 中使用變量作為目標(biāo)文件名?

        Using variables in Gulp for the destination file name?(在 Gulp 中使用變量作為目標(biāo)文件名?)
          <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 中使用變量作為目標(biāo)文件名?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我是 gulp 的新手,我想知道我想要實(shí)現(xiàn)的目標(biāo)是實(shí)際的還是可能的.

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

                  我的項(xiàng)目結(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 文件存儲(chǔ)在 public/assets 的相應(yīng) css 文件夾中,但使用它找到 scss 文件的文件夾的名稱.那可能嗎?我需要將它傳送到插件嗎?謝謝!PS我確實(shí)意識(shí)到我可以通過重命名scss來實(shí)現(xiàn)這一點(diǎ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.

                  推薦答案

                  這不會(huì)太難,這取決于你需要多少動(dòng)態(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.

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

                  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)在您將為每個(gè)組件創(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è)可以構(gòu)建所有組件的任務(wù).

                  You also have a task that can build all components.

                  這篇關(guān)于在 Gulp 中使用變量作為目標(biāo)文件名?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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(如何一個(gè)接一個(gè)地依次運(yùn)行 Gulp 任務(wù))
                  Stylesheet not loaded because of MIME-type(由于 MIME 類型而未加載樣式表)
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時(shí) 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>

                            主站蜘蛛池模板: 一区不卡在线观看 | 97超碰站| 高清视频一区二区三区 | 亚洲综合色视频在线观看 | 欧美一区免费 | 亚洲精品不卡 | 成人在线免费视频 | 欧美日韩手机在线观看 | 久久99国产精一区二区三区 | 在线观看成人免费视频 | 国产精品久久久久久影视 | 精品国产31久久久久久 | 亚洲一区二区精品视频 | 精品日韩在线 | 精品中文视频 | 中文字幕一区在线观看视频 | 日韩精品在线一区 | 久久一区二区视频 | 在线一级片 | 国产精品久久久久久一区二区三区 | 日韩高清不卡 | 99视频精品 | 国产视频一区二区 | 精品美女久久久久久免费 | 在线欧美视频 | 91中文字幕 | 精品一区二区三区在线观看国产 | 日韩视频一区二区 | 色秀网站 | 黄色一级毛片 | 国产精品一区久久久 | 亚洲 一区| 日韩中文字幕2019 | 人人操日日干 | 在线观看黄色大片 | 中文字幕1区2区 | 亚洲精品国产成人 | 中文字幕国产 | 久久久久久久国产精品影院 | 欧美中文字幕一区 | 久久成人免费观看 |