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

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

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

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

      gulp中vinyl-buffer和gulp-streamify的目的是什么?

      What are the purposes of vinyl-buffer and gulp-streamify in gulp?(gulp中vinyl-buffer和gulp-streamify的目的是什么?)

        <tbody id='UluCl'></tbody>
        <bdo id='UluCl'></bdo><ul id='UluCl'></ul>

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

                <tfoot id='UluCl'></tfoot>
              • <legend id='UluCl'><style id='UluCl'><dir id='UluCl'><q id='UluCl'></q></dir></style></legend>

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

              • 本文介紹了gulp中vinyl-buffer和gulp-streamify的目的是什么?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

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

                正如文檔所說(shuō),它們都處理將非流插件轉(zhuǎn)換為流.

                As the documentation says, they both deal with transforming non-stream plugins to stream.

                我試圖理解的是,如果我可以在某物上使用 .pipe() 方法,這不就意味著它是一個(gè)流嗎?

                What I try to understand is, if I can use the .pipe() method on something, doesn't it mean it's a stream?

                如果是這樣,我應(yīng)該在這里轉(zhuǎn)換成什么?

                If so, what do I convert to what here?


                (來(lái)自:https://www.npmjs.com/package/vinyl-buffer)

                var browserify = require('browserify')
                var source = require('vinyl-source-stream')
                var buffer = require('vinyl-buffer')
                var uglify = require('gulp-uglify')
                var size = require('gulp-size')
                var gulp = require('gulp')
                
                gulp.task('build', function() {
                  var bundler = browserify('./index.js')
                
                  return bundler.pipe()
                    .pipe(source('index.js'))
                    .pipe(buffer()) // <---------------------- why?
                    .pipe(uglify())
                    .pipe(size())
                    .pipe(gulp.dest('dist/'))
                })
                


                (來(lái)自:https://www.npmjs.com/package/vinyl-source-流)

                var source = require('vinyl-source-stream')
                var streamify = require('gulp-streamify')
                var browserify = require('browserify')
                var uglify = require('gulp-uglify')
                var gulp = require('gulp')
                
                gulp.task('browserify', function() {
                  var bundleStream = browserify('index.js').bundle()
                
                  bundleStream
                    .pipe(source('index.js'))
                    .pipe(streamify(uglify())) // <----------- why?
                    .pipe(gulp.dest('./bundle.js'))
                })
                

                推薦答案

                一個(gè)半有用的例子是考慮用一桶水撲滅篝火.要撲滅大火,您需要先將桶完全裝滿,然后再將其倒入火中,而不是在桶中滴幾滴,然后隨著時(shí)間的流逝將大量小滴倒入火中.這個(gè)比喻并不能說(shuō)明一切,但重要的是:你需要一桶水才能撲滅大火.

                One semi-useful example is to think about putting out a campfire with a bucket of water. To put out the fire you would want to completely fill up the bucket before dumping it on the fire rather putting a few drops in the bucket and then dumping lots of little drops over time on the fire. This metaphor doesn't capture everything but the big idea is this: you need a FULL bucket of water before you can put out the fire.

                那個(gè)uglify"插件的工作方式是一樣的.想象一下你想要壓縮/丑化的一些巨大的 JS 文件.

                That "uglify" plugin works the same way. Imagine some enormous JS file you'd want to compress/uglify.

                加載整個(gè)代碼庫(kù)需要一點(diǎn)時(shí)間你肯定不想嘗試縮小每一行,對(duì)吧?想象一下,你加載一行,縮小它,加載另一行,縮小它等等——這會(huì)是一團(tuán)糟.您無(wú)法對(duì)其進(jìn)行流式傳輸(您需要完整的代碼桶"才能對(duì)其進(jìn)行丑化.)要正確丑化該文件,您需要先加載 all 該代碼,然后再嘗試對(duì)其進(jìn)行丑化.

                It will take a little bit of time to load the whole codebase & you definitely wouldn't want to try minifying each line as it comes in, right? Imagine you load a single line, minify it, load another line, minify it, etc etc-- it'd be a mess. You can't stream it (you need a full "bucket" of code before you can uglify it.) To uglify that file properly you'd need to load all that code first before attempting to uglify it.

                由于 Gulp 是一個(gè)流式"構(gòu)建系統(tǒng),因此您不能使用 uglify,除非您有某種機(jī)制將流轉(zhuǎn)換為緩沖區(qū)(并且當(dāng)它完成時(shí)發(fā)出一個(gè)流.)您提到的兩種工具都可以實(shí)現(xiàn)這一點(diǎn).

                Since Gulp is a "streaming" build system, you can't use uglify unless you have some mechanism to turn the stream into a buffer (& when it's done emit a stream.) Both tools you mention make this possible.

                流程如下:STREAM > (BUFFER) > {對(duì)整個(gè)緩沖"文件執(zhí)行一些工作} > STREAM > {其他 gulp 工作等}

                Here's the flow: STREAM > (BUFFER) > {perform some work on the whole "buffered" file} > STREAM > {other gulp work, etc }

                對(duì)于您的具體問(wèn)題,您可以使用 .pipe() 因?yàn)関inyl-buffer/gulp-streamify 幫助將流轉(zhuǎn)換"為緩沖區(qū),然后將緩沖區(qū)轉(zhuǎn)換為流".它們是完成本質(zhì)上相同的事情的不同方法.

                To your specific question, you can use .pipe() because vinyl-buffer/gulp-streamify help "convert" streams to buffers then buffers to streams. They're different approaches to accomplish essentially the same thing.

                這篇關(guān)于gulp中vinyl-buffer和gulp-streamify的目的是什么?的文章就介紹到這了,希望我們推薦的答案對(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 類型而未加載樣式表)
                Visual Studio 2015 crashes when opening Javascript files(打開(kāi) Javascript 文件時(shí) Visual Studio 2015 崩潰)

                    <tbody id='GeBXI'></tbody>

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

                    <tfoot id='GeBXI'></tfoot>
                      <bdo id='GeBXI'></bdo><ul id='GeBXI'></ul>

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

                        • 主站蜘蛛池模板: 91精品国产99久久久久久红楼 | 天海翼一区二区 | 六月激情婷婷 | 日韩av在线不卡 | 久久成人毛片 | 中文字幕在线免费看 | 99久久视频 | 一级片在线观看视频 | 一级大片免费看 | 欧美一区| 少妇高潮av久久久久久 | 黄色大毛片| 蜜桃av一区二区三区 | 久久国产欧美 | 精品视频免费 | 亚洲丝袜一区 | 免费黄色一级视频 | 日韩福利在线观看 | 三级网站在线 | 久久最新视频 | 日韩在线免费播放 | 一区二区三区在线免费 | 国产一级一片免费播放放a 免费国产视频 | 国产精品成人一区二区三区 | 欧美精品综合 | 玖玖在线视频 | 欧美一级片| 国产免费黄色片 | 日本黄色免费看 | 一区视频在线 | 超碰97免费 | 午夜视频 | 超碰在线中文字幕 | 国产精品美女久久久久久久久 | 欧美黄色一级 | www.com国产| 99re在线视频| 91一区| 欧美性猛交乱大交 | 日本伊人久久 | 美女视频福利 |