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

    <bdo id='jpcXN'></bdo><ul id='jpcXN'></ul>
<legend id='jpcXN'><style id='jpcXN'><dir id='jpcXN'><q id='jpcXN'></q></dir></style></legend>
<tfoot id='jpcXN'></tfoot>

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

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

    1. Gulp - 復制和重命名文件

      Gulp - copy and rename a file(Gulp - 復制和重命名文件)
        <tbody id='FHCkh'></tbody>
      <legend id='FHCkh'><style id='FHCkh'><dir id='FHCkh'><q id='FHCkh'></q></dir></style></legend>

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

                本文介紹了Gulp - 復制和重命名文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我對 Gulp 非常陌生.我基本上是在嘗試查看修改過的 JavaScript 文件,然后用新名稱制作它的新副本.(最終會有一些處理,但羅馬不是一天建成的).

                I'm extremely new to Gulp. I'm basically trying to watch for a modified JavaScript file, and then make a new copy of it with a new name. (eventually there'll be some processing on it, but Rome wasn't built in a day).

                我的(天真的)嘗試是這樣的:

                My (naive) attempt is this:

                gulp.task('default', function() {
                
                    return gulp.watch('../**/**.js', function(obj){
                        gulp.src(obj.path)
                            .pipe(gulp.dest('foobar.js'));
                    });
                
                });
                

                這會獲取修改后的文件并成功地將其復制到現在名為 foobar.js 的文件夾中.有什么簡單的方法可以替換 gulp.dest('foobar.js') ,只需復制并重命名 src 文件嗎?

                This takes the modified file and successfully copies it into a folder now called foobar.js. Is there anything simple I can replace gulp.dest('foobar.js') with that will simply copy and rename the src file in place?

                編輯

                就地復制,我的意思是我想獲取修改后的文件,并在它當前所在的位置用一個新名稱復制它.相當于單擊文件(在 Windows 中)并按 control-c control-v,然后重命名生成的文件.

                By copy in place, I mean I want to take the modified file, and make a copy of it right where it currently is with a new name. The equivalent of clicking the file (in windows) and hitting control-c control-v, then renaming the resulting file.

                推薦答案

                我不是 100% 確定你的意思

                I'm not 100% certain what you mean by

                復制并重命名 ... 就地

                copy and rename ... in place

                但是,根據您當前的代碼,如果您只是希望:

                But, based on your current code, if you simply wish to:

                1. 查看目錄下的所有.js文件和
                2. 將它們復制到 cwd(當前工作目錄)并
                3. 命名所有副本,無論源文件,相同的東西
                1. Watch all .js files in the parent directory and
                2. Copy them to the cwd (current working directory) and
                3. Name all copies, regardless of source file, the same thing

                那么你可以使用 gulp-rename 來做到這一點:

                Then you could use gulp-rename to do just that:

                var gulp = require('gulp');
                var rename = require('gulp-rename');
                
                gulp.task('default', function() {
                  return gulp.watch('../**/**.js', function(obj) {
                    gulp.src(obj.path)
                      .pipe(rename('newFileName.js'))
                      .pipe(gulp.dest('.'));
                  });
                });
                

                在這種情況下,輸出文件名是 newFileName.js

                In this case, the output filename is newFileName.js

                為了使用該模塊,您需要使用 npm 安裝 gulp-rename 包(即:npm install gulp-rename).

                In order to use the module, you'll need to install the gulp-rename package with npm (ie: npm install gulp-rename).

                更多示例可在 npm @ https://www 的包詳細信息頁面上找到.npmjs.com/package/gulp-rename#usage

                More examples are available on the package details page on npm @ https://www.npmjs.com/package/gulp-rename#usage

                這篇關于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 崩潰)

                    <tfoot id='eE4Qc'></tfoot>
                  • <small id='eE4Qc'></small><noframes id='eE4Qc'>

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

                            <tbody id='eE4Qc'></tbody>
                          主站蜘蛛池模板: 免费在线播放黄色 | 91精品国产一区二区三区动漫 | 91精品国产色综合久久不卡98口 | 免费xxxx大片国产在线 | 狠狠综合久久av一区二区小说 | 国产视频久 | 日韩高清www| 日韩国产一区二区三区 | 91精品久久久久久久久中文字幕 | 羞羞视频免费在线 | 久久精品二区 | 久久久91 | 国产成人精品一区二三区在线观看 | 激情一区二区三区 | 久久久亚洲 | 中文字幕亚洲精品在线观看 | 国产一区电影 | 国产精品久久一区二区三区 | 欧美男人天堂 | 亚洲精品一区中文字幕乱码 | av福利网站 | 中国美女av| 尤物在线精品视频 | 日日摸天天添天天添破 | 午夜欧美一区二区三区在线播放 | 久久久久九九九女人毛片 | 黄篇网址 | 欧美五月婷婷 | 午夜视频在线免费观看 | 男女啪啪高潮无遮挡免费动态 | 精品视频一区二区三区在线观看 | 国产99久久精品一区二区永久免费 | 精品一区二区三区在线视频 | 国产成视频在线观看 | 亚洲性综合网 | 爱草在线| 91久久精品国产 | 日韩欧美久久精品 | 91久久综合亚洲鲁鲁五月天 | 国产在线资源 | 看一级毛片视频 |