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

  • <tfoot id='9ooJB'></tfoot>

  • <legend id='9ooJB'><style id='9ooJB'><dir id='9ooJB'><q id='9ooJB'></q></dir></style></legend>

      <small id='9ooJB'></small><noframes id='9ooJB'>

        <bdo id='9ooJB'></bdo><ul id='9ooJB'></ul>
      <i id='9ooJB'><tr id='9ooJB'><dt id='9ooJB'><q id='9ooJB'><span id='9ooJB'><b id='9ooJB'><form id='9ooJB'><ins id='9ooJB'></ins><ul id='9ooJB'></ul><sub id='9ooJB'></sub></form><legend id='9ooJB'></legend><bdo id='9ooJB'><pre id='9ooJB'><center id='9ooJB'></center></pre></bdo></b><th id='9ooJB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9ooJB'><tfoot id='9ooJB'></tfoot><dl id='9ooJB'><fieldset id='9ooJB'></fieldset></dl></div>
      1. 使用 Browserify 和 Gulp 使用共享的公共庫創建單獨

        Create separate JavaScript bundles with a shared common library using Browserify and Gulp(使用 Browserify 和 Gulp 使用共享的公共庫創建單獨的 JavaScript 包)

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

                <tbody id='kWdFK'></tbody>

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

                • <bdo id='kWdFK'></bdo><ul id='kWdFK'></ul>
                • 本文介紹了使用 Browserify 和 Gulp 使用共享的公共庫創建單獨的 JavaScript 包的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  對于我的工作團隊,我正在嘗試在 Gulp 和 Browserify 的幫助下建立一個半自動化 JavaScript 腳本和依賴管理系統.

                  我什至不確定使用當前可用的工具集(以及我有限的 JavaScript 知識)是否可以實現我想要實現的目標.我相信我想要實現的是一個非常常見的場景,但我無法找到我一直在尋找的信息.

                  考慮下圖:

                  線條表示依賴關系.對于共享模塊,例如 Module-vModule-y,我不希望通過包含在它們各自的包中來復制腳本.p>

                  我知道使用 Browserify 我可以手動忽略或排除模塊,這在項目還很年輕時很好 - 但隨著項目的增長,管理需要包含哪些依賴項將變得非常麻煩.

                  我認為這里有一個 類似的問答我要問的本質相同,但對我來說,還不是很清楚.它還引用了 gulp-browserify,它已被列入黑名單.

                  在我的圖表中,我可以看到我有三個 Browserify 入口點,但我缺乏 Gulp/Node/Browserify 經驗意味著我正在努力思考如何嘗試實現我想要的.

                  我很高興能夠嘗試將其拼湊起來,正如我已經嘗試過的那樣 - 但是項目經理正在喘不過氣來,所以我不得不拼湊一個臨時的解決方案",直到我可以實施一些更自動化和更強大的東西.

                  提前致謝.

                  編輯

                  從 Browserify 的插件文檔看來,這可能可以通過使用 factor-bundle 其中 子棧 指出給我;然而,由于我缺乏 Node/Browserify/Gulp 經驗,我再次努力將所有部分整合在一起.

                  相關問題

                  • 如何以編程方式將 factor-bundle 與 browserify 一起使用?

                  解決方案

                  想通了,分享經驗:

                  代碼示例:

                  var gulp = require('gulp'),source = require('vinyl-source-stream'),browserify = require('browserify'),因子 = 要求(因子捆綁");gulp.task('瀏覽器', function(){返回瀏覽器化({條目:['blog.js', 'page.js']}).plugin(因素,{//文件輸出順序必須與入口順序一致o: ['bundle/blog.js', 'bundle/page.js']}).捆({調試:真}).pipe(source('common.js')).pipe(gulp.dest('bundle/'));});

                  此輸出與圖表的主要區別在于,common.js 文件是根據 blog.jspage 之間的共同依賴關系自動生成的.js.這在 factor-bundle 文檔中有描述.

                  注意事項:

                  • 我發現如果輸出文件不存在,Node 會拋出錯誤.我不確定為什么我會假設 factor-bundle 只是將流寫入輸出文件,而不管它是否存在.作為一種解決方法,在清理"輸出目錄之后,我只是創建了占位符"文件以保持其正常運行.

                  • 我還沒弄清楚如何訪問 factor-bundle 流事件 當將其用作 browserify 插件時(甚至可能無法實現),因此對輸出文件的任何進一步工作(例如 uglifying 等)都可能需要在管道中的其他地方完成,可能需要使用另一個 browserify 插件,甚至事后.

                  For my team at work, I'm trying to set up a semi-automated JavaScript script and dependency management system with the help of Gulp and Browserify.

                  I'm not even sure if what I'm trying to achieve is possible with the currently available set of tools (and my limited JavaScript knowledge). I believe what I'm trying to achieve is a pretty common scenario, but I haven't been able to find the information I've been looking for.

                  Consider the following diagram:

                  The lines indicate depedencies. For shared modules, such as Module-v and Module-y, I don't want the scripts to be duplicated by being included in each of their respective bundles.

                  I know that using Browserify I can manually ignore or exclude modules, which is fine when the project is young - but as the project grows managing which dependencies need to be included where is going to become very cumbersome.

                  A similar Q&A here I think has the same essence of what I'm trying to ask, but to me, it isn't quite clear. It also references gulp-browserify which has since been blacklisted.

                  In my diagram, I can see that I have three Browserify entry points, but my lack of Gulp/Node/Browserify experience means I'm struggling to wrap my head around how I can try to achieve what I want to.

                  I'm happy to do the work to try and piece it together, as I already have been trying - however project managers are breathing down my neck so I'm having to hack together a temporary "solution" until I can implement something a little more automated and robust.

                  Thanks in advance.

                  Edit

                  It seems from Browserify's plugin documentation that this might be able to be achieved by using factor-bundle which substack pointed out to me; however again due to my lack of Node/Browserify/Gulp experience I am struggling to pull all the pieces together.

                  Related Questions

                  • How can I use factor-bundle with browserify programmatically?

                  解決方案

                  Figured it out, sharing the learns:

                  Code example:

                  var gulp = require('gulp'),
                      source = require('vinyl-source-stream'),
                      browserify = require('browserify'),
                      factor = require('factor-bundle');
                  
                  gulp.task('browserify', function(){
                  
                      return browserify({
                          entries: ['blog.js', 'page.js']
                      })
                      .plugin(factor, {
                          // File output order must match entry order
                          o: ['bundle/blog.js', 'bundle/page.js']
                      })
                      .bundle({
                          debug: true
                      })
                      .pipe(source('common.js'))
                      .pipe(gulp.dest('bundle/'));
                  
                  });
                  

                  The key difference between this output and the diagram, is that the common.js file is automatically generated based on common depenedencies between blog.js and page.js. This is described in the factor-bundle documentation.

                  Notes:

                  • I found that Node would throw an error if the output files didn't already exist. I'm unsure why as I would have assumed that factor-bundle would simply write a stream to the outputting file regardless of whether it was there or not. As a workaround, after 'cleaning' the output directory, I simply created 'placeholder' files to keep it happy.

                  • I haven't figured out how to access the factor-bundle stream event when using it as a browserify plugin (it may not even be possible), so any further work on the output files (such as uglifying etc) would likely need to be done somewhere else in the pipeline, possibly with another browserify plugin, or even after the fact.

                  這篇關于使用 Browserify 和 Gulp 使用共享的公共庫創建單獨的 JavaScript 包的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)
                • <i id='hzNIo'><tr id='hzNIo'><dt id='hzNIo'><q id='hzNIo'><span id='hzNIo'><b id='hzNIo'><form id='hzNIo'><ins id='hzNIo'></ins><ul id='hzNIo'></ul><sub id='hzNIo'></sub></form><legend id='hzNIo'></legend><bdo id='hzNIo'><pre id='hzNIo'><center id='hzNIo'></center></pre></bdo></b><th id='hzNIo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hzNIo'><tfoot id='hzNIo'></tfoot><dl id='hzNIo'><fieldset id='hzNIo'></fieldset></dl></div>
                    <bdo id='hzNIo'></bdo><ul id='hzNIo'></ul>

                    <tfoot id='hzNIo'></tfoot>
                      <legend id='hzNIo'><style id='hzNIo'><dir id='hzNIo'><q id='hzNIo'></q></dir></style></legend>

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

                            <tbody id='hzNIo'></tbody>

                            主站蜘蛛池模板: 99精品网 | 亚洲一区不卡在线 | 亚洲人在线 | 国产精品成人一区二区 | 国产精品免费一区二区三区四区 | 黄色在线免费观看视频网站 | 青青久在线视频 | 久久出精品 | 日韩精品一区二区三区在线播放 | 国产精品永久久久久久久www | 正在播放国产精品 | 精品人伦一区二区三区蜜桃网站 | 久久久久久成人 | 日本超碰 | 国产精品美女久久久久aⅴ国产馆 | 日韩av在线一区二区三区 | 国产一区二区在线视频 | 三级黄视频在线观看 | 久久成人精品一区二区三区 | 欧美aⅴ | 欧美精品中文字幕久久二区 | 成人免费观看男女羞羞视频 | 91精品国产综合久久国产大片 | 一区二区视屏 | 免费九九视频 | 色中文在线 | 久久成人一区 | 国产成人免费视频网站高清观看视频 | 久久精品国产亚洲一区二区三区 | 精品亚洲国产成av人片传媒 | 美女视频一区二区三区 | 最新午夜综合福利视频 | 日韩快播电影网 | 精品久久久久久红码专区 | 成人片网址| 免费簧片视频 | 天天干天天插天天 | 国产午夜精品一区二区 | 欧洲一区二区三区 | 亚洲国产情侣 | 国产女人叫床高潮大片免费 |