pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

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

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

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

        在 gulp 任務中刪除文件

        Deleting files in a gulp task(在 gulp 任務中刪除文件)
          <tbody id='A7Gyp'></tbody>
          • <tfoot id='A7Gyp'></tfoot>

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

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

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

                  本文介紹了在 gulp 任務中刪除文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個 gulp 任務,我想獲取一些源文件并將它們復制到 build/premiumbuild/free 然后從構建/免費.

                  我的嘗試是這樣做的:

                  gulp.task("build", ["clean"], function () {gulp.src(["src/*", "!src/composer.*", "LICENSE"]).pipe(gulp.dest("build/premium")).pipe(del(["build/free/plugins/*", "!build/free/plugins/index.php"])).pipe(gulp.dest("build/free"));});

                  這會導致錯誤:

                  TypeError: dest.on 不是函數在 DestroyableTransform.Stream.pipe (stream.js:45:8)在 Gulp.<匿名>(/Users/gezim/projects/myproj/gulpfile.js:9:6)

                  如何在刪除端口時完成此操作?有沒有更好的方法來做到這一點?

                  解決方案

                  我會使用 gulp-filter 只刪除不應該從第二個目的地復制的內容.

                  我將任務的意圖解釋為希望 src 中存在的所有內容都存在于 build/premium 中.但是,build/free 應該排除最初在 src/plugins 中但仍應包含 src/plugins/index.php 的所有內容.p>

                  這是一個有效的 gulpfile:

                  var gulp = require("gulp");var filter = require("gulp-filter");變種德爾=要求(德爾");gulp.task("干凈", function () {返回德爾(構建");});gulp.task("build", ["clean"], function () {返回 gulp.src(["src/**", "!src/composer.*", "LICENSE"]).pipe(gulp.dest("build/premium")).pipe(filter(["**", "!plugins/**", "plugins/index.php"])).pipe(gulp.dest("build/free"));});

                  傳遞給 filter 的模式是 relative 路徑.由于 gulp.src 模式具有 src/** 這意味著它們是相對于 src 的.

                  還要注意,del 不能直接傳遞給 .pipe(),因為它返回一個承諾.它可以從任務中返回,就像 clean 任務一樣.

                  I have a gulp task in which I want to take some source files and copy them to build/premium and build/free and then remove some extra files from build/free.

                  My attempt at that was doing this:

                  gulp.task("build", ["clean"], function () {
                    gulp.src(["src/*", "!src/composer.*", "LICENSE"])
                      .pipe(gulp.dest("build/premium"))
                      .pipe(del(["build/free/plugins/*", "!build/free/plugins/index.php"]))
                      .pipe(gulp.dest("build/free"));
                  });
                  

                  Which results in an error:

                  TypeError: dest.on is not a function
                      at DestroyableTransform.Stream.pipe (stream.js:45:8)
                      at Gulp.<anonymous> (/Users/gezim/projects/myproj/gulpfile.js:9:6)
                  

                  How do I accomplish this the deleting port? Is there a better way altogether to do this?

                  解決方案

                  I would use gulp-filter to drop only what should not be copied from the 2nd destination.

                  I interpreted the intent of the task as wanting everything present in src to be present in build/premium. However, build/free should exclude everything which was originally in src/plugins but should still include src/plugins/index.php.

                  Here is a working gulpfile:

                  var gulp = require("gulp");
                  var filter = require("gulp-filter");
                  var del = require("del");
                  
                  gulp.task("clean", function () {
                    return del("build");
                  });
                  
                  gulp.task("build", ["clean"], function () {
                    return gulp.src(["src/**", "!src/composer.*", "LICENSE"])
                      .pipe(gulp.dest("build/premium"))
                      .pipe(filter(["**", "!plugins/**", "plugins/index.php"]))
                      .pipe(gulp.dest("build/free"));
                  });
                  

                  The patterns passed to filter are relative paths. Since the gulp.src pattern has src/** it means they are relative to src.

                  Note also that del cannot be passed straight to .pipe() as it returns a promise. It can be returned from a task, like the clean task does.

                  這篇關于在 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='wabVi'></tfoot>

                          <tbody id='wabVi'></tbody>
                        <legend id='wabVi'><style id='wabVi'><dir id='wabVi'><q id='wabVi'></q></dir></style></legend>

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

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

                          • 主站蜘蛛池模板: 厦门ISO认证|厦门ISO9001认证|厦门ISO14001认证|厦门ISO45001认证-艾索咨询专注ISO认证行业 | 线材成型机,线材折弯机,线材成型机厂家,贝朗自动化设备有限公司1 | 百方网-百方电气网,电工电气行业专业的B2B电子商务平台 | 瑞典Blueair空气净化器租赁服务中心-专注新装修办公室除醛去异味服务! | 真空包装机-诸城市坤泰食品机械有限公司 | 并网柜,汇流箱,电控设备,中高低压开关柜,电气电力成套设备,PLC控制设备订制厂家,江苏昌伟业新能源科技有限公司 | 驾驶式洗地机/扫地机_全自动洗地机_工业洗地机_荣事达工厂官网 | 机制砂选粉机_砂石选粉机厂家-盐城市助成粉磨科技有限公司 | 希望影视-高清影视vip热播电影电视剧免费在线抢先看 | 飞扬动力官网-广告公司管理软件,广告公司管理系统,喷绘写真条幅制作管理软件,广告公司ERP系统 | 压砖机、液压制砖机、静压砖机、环保砖机生产厂家—杜甫机械 | 温州富欧金属封头-不锈钢封头厂家| 泥浆在线密度计厂家-防爆数字压力表-膜盒-远传压力表厂家-江苏大亚自控设备有限公司 | 有源电力滤波装置-电力有源滤波器-低压穿排电流互感器|安科瑞 | 电线电缆厂家|沈阳电缆厂|电线厂|沈阳英联塑力线缆有限公司 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | 柔性输送线|柔性链板|齿形链-上海赫勒输送设备有限公司首页[输送机] | 361°官方网站| 哈尔滨京科脑康神经内科医院-哈尔滨治疗头痛医院-哈尔滨治疗癫痫康复医院 | 分光色差仪,测色仪,反透射灯箱,爱色丽分光光度仪,美能达色差仪维修_苏州欣美和仪器有限公司 | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | 澳洁干洗店加盟-洗衣店干洗连锁「澳洁干洗免费一对一贴心服务」 干洗加盟网-洗衣店品牌排行-干洗设备价格-干洗连锁加盟指南 | 干洗加盟网-洗衣店品牌排行-干洗设备价格-干洗连锁加盟指南 | 精密线材测试仪-电线电缆检测仪-苏州欣硕电子科技有限公司 | 恒温恒湿箱(药品/保健品/食品/半导体/细菌)-兰贝石(北京)科技有限公司 | 优秀的临床医学知识库,临床知识库,医疗知识库,满足电子病历四级要求,免费试用 | 聚氨酯复合板保温板厂家_廊坊华宇创新科技有限公司 | 光谱仪_积分球_分布光度计_灯具检测生产厂家_杭州松朗光电【官网】 | 广州食堂承包_广州团餐配送_广州堂食餐饮服务公司 - 旺记餐饮 | 刑事律师_深圳著名刑事辩护律师_王平聚【清华博士|刑法教授】 | 微信聊天记录恢复_手机短信删除怎么恢复_通讯录恢复软件下载-快易数据恢复 | 广东护栏厂家-广州护栏网厂家-广东省安麦斯交通设施有限公司 | 预制舱-电力集装箱预制舱-模块化预制舱生产厂家-腾达电器设备 | 涂层测厚仪_光泽度仪_uv能量计_紫外辐照计_太阳膜测试仪_透光率仪-林上科技 | 老城街小面官网_正宗重庆小面加盟技术培训_特色面馆加盟|牛肉拉面|招商加盟代理费用多少钱 | 分轨 | 上传文件,即刻分离人声和伴奏 | 通用磨耗试验机-QUV耐候试验机|久宏实业百科| 仿古瓦,仿古金属瓦,铝瓦,铜瓦,铝合金瓦-西安东申景观艺术工程有限公司 | 熔体泵_熔体出料泵_高温熔体泵-郑州海科熔体泵有限公司 | 泵阀展|阀门展|水泵展|流体机械展 -2025上海国际泵管阀展览会flowtech china | 硅胶布|电磁炉垫片|特氟龙胶带-江苏浩天复合材料有限公司 |