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

      <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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 按順序連接腳本的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

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

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

                //JS concat,剝離調試和縮小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里面的腳本順序無關,看目錄下的文件.

                那么有人對此有什么想法嗎?

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

                隨著我了解的更多,我發現 Browserify 是一個很好的解決方案,一開始可能會很痛苦,但它很棒.

                解決方案

                我最近在構建我的 AngularJS 應用程序時遇到了與 Grunt 類似的問題.這是我發布的一個問題.p>

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

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

                Grunt 能夠找出哪些文件是重復的并且不包含它們.同樣的技術也適用于 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.

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

                  <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="qwawimqqmiuu" id='33yQ5'><tfoot id='33yQ5'></tfoot><dl id='33yQ5'><fieldset id='33yQ5'></fieldset></dl></div>

                        • 主站蜘蛛池模板: 欧美精品一区二区三区在线播放 | 久久九九色 | 国产成人免费视频网站视频社区 | 在线观看特色大片免费网站 | 国产激情一区二区三区 | 日日干综合 | 亚洲综合色 | 成人国产精品一级毛片视频毛片 | 第四色狠狠| 免费国产一区二区视频 | av在线视| 亚洲一区中文 | 九九免费观看视频 | 五月婷婷婷 | 91小视频 | 成人免费视频网站在线观看 | caoporn国产精品免费公开 | 伊人网综合 | 99re热精品视频 | 日韩久久精品电影 | 国产精品久久久久久久久免费桃花 | 一区二区三区高清 | 免费成人在线网站 | 国产av毛片 | 中文字幕免费 | 国产农村妇女精品一二区 | 亚洲韩国精品 | 国产精品久久精品 | 欧美精品一区二区三区在线 | 在线a视频 | 日韩男人天堂 | 日韩高清一区 | 国产一区二区日韩 | av黄色在线播放 | 欧美日韩在线视频一区二区 | 欧美一区二区三区高清视频 | 日日操夜夜操天天操 | 国产美女自拍视频 | 自拍偷拍中文字幕 | 毛片a级毛片免费播放100 | 欧美一二区 |