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

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

  1. <legend id='QFYnF'><style id='QFYnF'><dir id='QFYnF'><q id='QFYnF'></q></dir></style></legend>

    1. <tfoot id='QFYnF'></tfoot>

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

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

      使用 Gulp 按順序連接腳本

      Concat scripts in order with Gulp(使用 Gulp 按順序連接腳本)

        <tfoot id='WREtF'></tfoot>

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

          2. <legend id='WREtF'><style id='WREtF'><dir id='WREtF'><q id='WREtF'></q></dir></style></legend>

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

                <bdo id='WREtF'></bdo><ul id='WREtF'></ul>
                本文介紹了使用 Gulp 按順序連接腳本的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

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

                例如,您正在 Backbone 或其他任何東西上構(gòu)建一個(gè)項(xiàng)目,并且您需要按特定順序加載腳本,例如underscore.js 需要在 backbone.js 之前加載.

                如何讓它連接腳本以使它們井井有條?

                //JS concat,剝離調(diào)試和縮小gulp.task('腳本', function() {gulp.src(['./source/js/*.js', './source/js/**/*.js']).pipe(concat('script.js')).pipe(stripDebug()).pipe(丑化()).pipe(gulp.dest('./build/js/'));});

                我的 source/index.html 中的腳本順序正確,但由于文件是按字母順序組織的,gulp 將在 之后連接 underscore.js>backbone.js,和我的source/index.html里面的腳本順序無(wú)關(guān),看目錄下的文件.

                那么有人對(duì)此有什么想法嗎?

                我最好的辦法是用 123 重命名供應(yīng)商腳本,以給它們正確的順序,但我是不知道我喜不喜歡這個(gè).

                隨著我了解的更多,我發(fā)現(xiàn) Browserify 是一個(gè)很好的解決方案,一開(kāi)始可能會(huì)很痛苦,但它很棒.

                解決方案

                我最近在構(gòu)建我的 AngularJS 應(yīng)用程序時(shí)遇到了與 Grunt 類(lèi)似的問(wèn)題.這是我發(fā)布的一個(gè)問(wèn)題.p>

                我最終做的是在 grunt 配置中按順序顯式列出文件.配置文件將如下所示:

                <代碼>['/path/to/app.js','/path/to/mymodule/mymodule.js','/path/to/mymodule/mymodule/*.js']

                Grunt 能夠找出哪些文件是重復(fù)的并且不包含它們.同樣的技術(shù)也適用于 Gulp.

                Say, for example, you are building a project on Backbone or whatever and you need to load scripts in a certain order, e.g. underscore.js needs to be loaded before backbone.js.

                How do I get it to concat the scripts so that they’re in order?

                // JS concat, strip debugging and minify
                gulp.task('scripts', function() {
                    gulp.src(['./source/js/*.js', './source/js/**/*.js'])
                    .pipe(concat('script.js'))
                    .pipe(stripDebug())
                    .pipe(uglify())
                    .pipe(gulp.dest('./build/js/'));
                });
                

                I have the right order of scripts in my source/index.html, but since files are organized by alphabetic order, gulp will concat underscore.js after backbone.js, and the order of the scripts in my source/index.html does not matter, it looks at the files in the directory.

                So does anyone have an idea on this?

                Best idea I have is to rename the vendor scripts with 1, 2, 3 to give them the proper order, but I am not sure if I like this.

                As I learned more I found Browserify is a great solution, it can be a pain at first but it’s great.

                解決方案

                I had a similar problem recently with Grunt when building my AngularJS app. Here's a question I posted.

                What I ended up doing is to explicitly list the files in order in the grunt config. The config file will then look like this:

                [
                  '/path/to/app.js',
                  '/path/to/mymodule/mymodule.js',
                  '/path/to/mymodule/mymodule/*.js'
                ]
                

                Grunt is able to figure out which files are duplicates and not include them. The same technique will work with Gulp as well.

                這篇關(guān)于使用 Gulp 按順序連接腳本的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(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 類(lèi)型而未加載樣式表)
                Visual Studio 2015 crashes when opening Javascript files(打開(kāi) Javascript 文件時(shí) Visual Studio 2015 崩潰)

                  <small id='33yQ5'></small><noframes id='33yQ5'>

                    <bdo id='33yQ5'></bdo><ul id='33yQ5'></ul>
                      <legend id='33yQ5'><style id='33yQ5'><dir id='33yQ5'><q id='33yQ5'></q></dir></style></legend>
                      <tfoot id='33yQ5'></tfoot>
                        <tbody id='33yQ5'></tbody>

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

                        • 主站蜘蛛池模板: 高通量组织研磨仪-多样品组织研磨仪-全自动组织研磨仪-研磨者科技(广州)有限公司 | 油漆辅料厂家_阴阳脚线_艺术漆厂家_内外墙涂料施工_乳胶漆专用防霉腻子粉_轻质粉刷石膏-魔法涂涂 | 网站建设_网站制作_SEO优化推广_百度推广开户_朋友圈网络科技 | 刺绳_刀片刺网_刺丝滚笼_不锈钢刺绳生产厂家_安平县浩荣金属丝网制品有限公司-安平县浩荣金属丝网制品有限公司 | 广州工业氧气-工业氩气-工业氮气-二氧化碳-广州市番禺区得力气体经营部 | 全自动五线打端沾锡机,全自动裁线剥皮双头沾锡机,全自动尼龙扎带机-东莞市海文能机械设备有限公司 | 冷油器,取样冷却器,热力除氧器-连云港振辉机械设备有限公司 | 一氧化氮泄露报警器,二甲苯浓度超标报警器-郑州汇瑞埔电子技术有限公司 | 2-羟基泽兰内酯-乙酰蒲公英萜醇-甘草查尔酮A-上海纯优生物科技有限公司 | 塑料异型材_PVC异型材_封边条生产厂家_PC灯罩_防撞扶手_医院扶手价格_东莞市怡美塑胶制品有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 玉米深加工机械,玉米加工设备,玉米加工机械等玉米深加工设备制造商-河南成立粮油机械有限公司 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 扬尘在线监测系统_工地噪声扬尘检测仪_扬尘监测系统_贝塔射线扬尘监测设备「风途物联网科技」 | 大米加工设备|大米加工机械|碾米成套设备|大米加工成套设备-河南成立粮油机械有限公司 | 冲锋衣滑雪服厂家-冲锋衣定制工厂-滑雪服加工厂-广东睿牛户外(S-GERT) | 污水处理设备,一体化泵站,一体化净水设备-「梦之洁环保设备厂家」 | 收录网| 电抗器-能曼电气-电抗器专业制造商 | 成都LED显示屏丨室内户外全彩led屏厂家方案报价_四川诺显科技 | 耐高温硅酸铝板-硅酸铝棉保温施工|亿欧建设工程 | 水冷式工业冷水机组_风冷式工业冷水机_水冷螺杆冷冻机组-深圳市普威机械设备有限公司 | 吲哚菁绿衍生物-酶底物法大肠菌群检测试剂-北京和信同通科技发展有限公司 | 展厅设计-展馆设计-专业企业展厅展馆设计公司-昆明华文创意 | 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 泰安塞纳春天装饰公司【网站】 | 众品家具网-家具品牌招商_家具代理加盟_家具门户的首选网络媒体。 | 防水套管厂家_刚性防水套管_柔性防水套管_不锈钢防水套管-郑州中泰管道 | 三氯异氰尿酸-二氯-三氯-二氯异氰尿酸钠-优氯净-强氯精-消毒片-济南中北_优氯净厂家 | RTO换向阀_VOC高温阀门_加热炉切断阀_双偏心软密封蝶阀_煤气蝶阀_提升阀-湖北霍科德阀门有限公司 | 恒温油槽-恒温水槽-低温恒温槽厂家-宁波科麦仪器有限公司 | 欧盟ce检测认证_reach检测报告_第三方检测中心-深圳市威腾检验技术有限公司 | 干式变压器厂_干式变压器厂家_scb11/scb13/scb10/scb14/scb18干式变压器生产厂家-山东科锐变压器有限公司 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 三价铬_环保铬_环保电镀_东莞共盈新材料贸易有限公司 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 亚克力制品定制,上海嘉定有机玻璃加工制作生产厂家—官网 | 千斤顶,液压千斤顶-力良企业,专业的液压千斤顶制造商,shliliang.com | 粉末包装机,拆包机厂家,价格-上海强牛包装机械设备有限公司 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 |