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

<tfoot id='nnvTr'></tfoot>

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

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

    2. 將 Gulp glob 鏈接到瀏覽器化轉換

      Chain Gulp glob to browserify transform(將 Gulp glob 鏈接到瀏覽器化轉換)

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

          • <small id='nL7Tc'></small><noframes id='nL7Tc'>

            <legend id='nL7Tc'><style id='nL7Tc'><dir id='nL7Tc'><q id='nL7Tc'></q></dir></style></legend>
              • <i id='nL7Tc'><tr id='nL7Tc'><dt id='nL7Tc'><q id='nL7Tc'><span id='nL7Tc'><b id='nL7Tc'><form id='nL7Tc'><ins id='nL7Tc'></ins><ul id='nL7Tc'></ul><sub id='nL7Tc'></sub></form><legend id='nL7Tc'></legend><bdo id='nL7Tc'><pre id='nL7Tc'><center id='nL7Tc'></center></pre></bdo></b><th id='nL7Tc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nL7Tc'><tfoot id='nL7Tc'></tfoot><dl id='nL7Tc'><fieldset id='nL7Tc'></fieldset></dl></div>
                <tfoot id='nL7Tc'></tfoot>
                  <tbody id='nL7Tc'></tbody>
                本文介紹了將 Gulp glob 鏈接到瀏覽器化轉換的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我有一個項目,其中包含幾個相對不相交的頁面,每個頁面都包含自己的入口點腳本.這些腳本需要其他一些使用commonjs語法的腳本,需要經過6to5轉換并被browserify打包.

                I have a project with a few relatively disjoint pages, each including their own entry point script. These scripts require a number of others using commonjs syntax, and need to be transformed by 6to5 and bundled by browserify.

                我想設置一個 gulp 任務來捕獲所有匹配模式的文件并將它們傳遞給捆綁程序,但我不確定如何將文件從 gulp.src 傳遞到瀏覽(文件名).

                I would like to set up a gulp task that captures all the files matching a pattern and passes them on to the bundler, but I'm not sure how to pass files from gulp.src to browserify(filename).

                我的 gulpfile 看起來像:

                My gulpfile looks like:

                var gulp = require("gulp");
                var browserify = require("browserify");
                var to5browserify = require("6to5-browserify");
                var source = require("vinyl-source-stream");
                
                var BUNDLES = [
                    "build.js",
                    "export.js",
                    "main.js"
                ];
                
                gulp.task("bundle", function () {
                    /* Old version, using glob:
                    return gulp.src("src/** /*.js")
                        .pipe(sixto5())
                        .pipe(gulp.dest("dist"));
                    */
                
                    // New version, using array:
                    return BUNDLES.map(function (bundle) {
                        return browserify("./src/" + bundle, {debug: true})
                            .transform(to5browserify)
                            .bundle()
                            .pipe(source(bundle))
                            .pipe(gulp.dest("./dist"));
                    });
                });
                
                gulp.task("scripts", ["bundle"]);
                
                gulp.task("html", function () {
                    return gulp.src("src/**/*.html")
                        .pipe(gulp.dest("dist"));
                });
                
                gulp.task("styles", function () {
                    return gulp.src("src/**/*.css")
                        .pipe(gulp.dest("dist"));
                });
                
                gulp.task("default", ["scripts", "html", "styles"]);
                

                這似乎可行,但不可維護:我將很快添加更多腳本,并且不想每次都將它們添加到數組中.

                This seems to work, but isn't maintainable: I'll be adding more scripts relatively soon, and don't want to add them to the array every time.

                我嘗試在 browserify 調用中使用 gulp.src(glob).pipe 并在調用后使用管道 (此處顯示)和 gulp.src(glob).map(方法不存在).

                I've tried using gulp.src(glob).pipe within the browserify call and piping after calling (shown here), and gulp.src(glob).map (method doesn't exist).

                如何將 gulp.src 與 browserify 等基于名稱的轉換器鏈接起來?

                How can you chain gulp.src with a name-based transformer like browserify?

                推薦答案

                使用through2制作一次性的自定義插件流,可以完成所有繁瑣的工作.

                Use through2 to make a one-off custom plugin stream that does all of the dirty work.

                不幸的是 vinyl-transformvinyl-source-stream 以及隨之而來的解決方案缺陷,所以我們必須去定制一些東西.

                Unfortanately vinyl-transform and vinyl-source-stream and the solutions that go along with those have flaws so we have to go for something custom.

                var gulp = require('gulp');
                var through = require('through2');
                var browserify = require('browserify');
                
                gulp.task('bundle', function() {
                    var browserified = function() {
                        return through.obj(function(chunk, enc, callback) {
                            if(chunk.isBuffer()) {
                                var b = browserify(chunk.path);
                                    // Any custom browserify stuff should go here
                                    //.transform(to5browserify);
                
                                chunk.contents = b.bundle();
                
                                this.push(chunk);
                
                            }
                            callback();
                        });
                    };
                
                    return gulp.src(['./src/**/*.js'])
                        .pipe(browserified())
                        .pipe(gulp.dest('dest'));
                });
                

                這篇關于將 Gulp glob 鏈接到瀏覽器化轉換的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)

                        <tbody id='4Muxb'></tbody>
                      <tfoot id='4Muxb'></tfoot>
                    • <legend id='4Muxb'><style id='4Muxb'><dir id='4Muxb'><q id='4Muxb'></q></dir></style></legend>

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

                          <small id='4Muxb'></small><noframes id='4Muxb'>

                        • 主站蜘蛛池模板: 欧美毛片免费观看 | 中文字幕日韩欧美 | 国产一区 | 国产精品99久久免费观看 | 国产精品一区二区不卡 | 免费观看黄色片视频 | 欧美国产精品久久久 | 国产精品美女在线观看 | 亚洲国产aⅴ成人精品无吗 亚洲精品久久久一区二区三区 | 日韩中文字幕在线免费 | 亚洲最新在线 | 2022精品国偷自产免费观看 | 国产精品久久久久久婷婷天堂 | 久久久一区二区三区四区 | 国产精品久久久久久影视 | 亚洲精品国产成人 | 国产国语精品 | av毛片在线播放 | 99久久久99久久国产片鸭王 | 蜜桃精品噜噜噜成人av | 国产精品久久久久久吹潮 | 久久亚洲欧美日韩精品专区 | 色婷婷久久久亚洲一区二区三区 | 涩色视频在线观看 | 欧美精品乱码99久久影院 | 国产福利在线小视频 | 国产一区二区 | 91久久夜色 | 亚洲精品欧美 | 日本亚洲精品成人欧美一区 | 中文字幕一区二区三区乱码在线 | 久久综合一区二区三区 | 精品少妇一区二区三区在线播放 | 久久99视频这里只有精品 | 久久久久国产精品一区二区 | 国产成人av电影 | 欧美一区二区三区 | 精品一区在线免费观看 | 亚洲精品一区中文字幕乱码 | 久久午夜视频 | 人人做人人澡人人爽欧美 |