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

  • <small id='2QoaD'></small><noframes id='2QoaD'>

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

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

        如何使用 browserify 和 gulp 輸出多個包

        how to output multiple bundles with browserify and gulp(如何使用 browserify 和 gulp 輸出多個包)
          • <i id='IPx4U'><tr id='IPx4U'><dt id='IPx4U'><q id='IPx4U'><span id='IPx4U'><b id='IPx4U'><form id='IPx4U'><ins id='IPx4U'></ins><ul id='IPx4U'></ul><sub id='IPx4U'></sub></form><legend id='IPx4U'></legend><bdo id='IPx4U'><pre id='IPx4U'><center id='IPx4U'></center></pre></bdo></b><th id='IPx4U'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IPx4U'><tfoot id='IPx4U'></tfoot><dl id='IPx4U'><fieldset id='IPx4U'></fieldset></dl></div>
            <tfoot id='IPx4U'></tfoot>

              <legend id='IPx4U'><style id='IPx4U'><dir id='IPx4U'><q id='IPx4U'></q></dir></style></legend>

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

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

                    <tbody id='IPx4U'></tbody>
                • 本文介紹了如何使用 browserify 和 gulp 輸出多個包的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有 browserify 捆綁文件,它工作得很好.但是如果我需要生成多個捆綁包怎么辦?

                  I have browserify bundling up files and it's working great. But what if I need to generate multiple bundles?

                  我想以 dist/appBundle.jsdist/publicBundle.js

                  gulp.task("js", function(){
                  
                      return browserify([
                              "./js/app.js",
                              "./js/public.js"
                          ])
                          .bundle()
                          .pipe(source("bundle.js"))
                          .pipe(gulp.dest("./dist"));
                  
                  });
                  

                  顯然這行不通,因為我只指定了一個輸出 (bundle.js).我可以通過像這樣重復(fù)上述語句來實現(xiàn)這一點(但感覺不對,因為重復(fù)):

                  Obviously this isn't going to work since I am only specifying one output (bundle.js). I can accomplish this by repeating the above statement like so (but it doesn't feel right, because of the repetition):

                  gulp.task("js", function(){
                  
                      browserify([
                              "./js/app.js"
                          ])
                          .bundle()
                          .pipe(source("appBundle.js"))
                          .pipe(gulp.dest("./dist"));
                  
                  
                      browserify([
                              "./js/public.js"
                          ])
                          .bundle()
                          .pipe(source("publicBundle.js"))
                          .pipe(gulp.dest("./dist"));
                  
                  });
                  

                  有沒有更好的方法來解決這個問題?謝謝!

                  Is there a better way to tackle this? Thanks!

                  推薦答案

                  我現(xiàn)在沒有一個好的環(huán)境來測試這個,但我猜它看起來像:

                  I don't have a good environment to test this in right now, but my guess is that it would look something like:

                  gulp.task("js", function(){
                      var destDir = "./dist";
                  
                      return browserify([
                          "./js/app.js",
                          "./js/public.js"
                      ])
                          .bundle()
                          .pipe(source("appBundle.js"))
                          .pipe(gulp.dest(destDir))
                          .pipe(rename("publicBundle.js"))
                          .pipe(gulp.dest(destDir));
                  
                  });
                  

                  我剛剛意識到我誤讀了這個問題,應(yīng)該有兩個單獨的包來自兩個單獨的 .js 文件.鑒于此,我能想到的最佳選擇如下:

                  I just realized I mis-read the question, there should be two separate bundles coming from two separate .js files. In light of that, the best alternative I can think of looks like:

                  gulp.task("js", function(){
                      var destDir = "./dist";
                  
                      var bundleThis = function(srcArray) {
                          _.each(srcArray, function(source) {
                              var bundle = browserify(["./js/" + source + ".js"]).bundle();
                              bundle.pipe(source(source + "Bundle.js"))
                                    .pipe(gulp.dest(destDir));
                          });
                      };
                  
                      bundleThis(["app", "public"]);
                  });
                  

                  這篇關(guān)于如何使用 browserify 和 gulp 輸出多個包的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  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?(是否可以將標(biāo)志傳遞給 Gulp 以使其以不同的方式運行任務(wù)?)
                  Why do we need to install gulp globally and locally?(為什么我們需要在全局和本地安裝 gulp?)
                  How to run Gulp tasks sequentially one after the other(如何一個接一個地依次運行 Gulp 任務(wù))
                  Visual Studio 2015 crashes when opening Javascript files(打開 Javascript 文件時 Visual Studio 2015 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)

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

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

                      <legend id='zKLGG'><style id='zKLGG'><dir id='zKLGG'><q id='zKLGG'></q></dir></style></legend>

                          <tbody id='zKLGG'></tbody>
                        1. <small id='zKLGG'></small><noframes id='zKLGG'>

                          • <bdo id='zKLGG'></bdo><ul id='zKLGG'></ul>
                            主站蜘蛛池模板: 欧美黄色一级视频 | 黄色综合网| 美日韩一区二区三区 | 久久久国产一区二区三区 | 91中文| 日韩伦理一区二区 | 成人国产在线 | 久久精品区 | 国产精品视频久久久 | 欧美日韩精品久久 | 亚洲图片一区二区 | 97人人看| 天堂av网站 | 九九精品免费视频 | 超碰成人在线观看 | 青青草免费观看 | 1024日韩 | 日本三级久久 | 天天澡天天狠天天天做 | 亚洲国产成人av | 免费黄色片视频 | 伊人9999 | 欧美国产精品一区二区 | 欧美精品自拍 | 欧美日在线 | 色日韩| 五月婷婷影院 | 国产日本在线观看 | 黄色成人小视频 | 国产呦小j女精品视频 | 综合久久99 | 国产又黄又爽 | 亚洲免费黄色 | 欧美少妇视频 | 成人免费小视频 | 麻豆视频一区 | 一区二区三区四区av | 狠狠干天天操 | 日韩中文字幕一区二区三区 | 日本精品久久久 | 天堂中文在线视频 |