久久久久久久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的目的是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                正如文檔所說,它們都處理將非流插件轉換為流.

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

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

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

                如果是這樣,我應該在這里轉換成什么?

                If so, what do I convert to what here?


                (來自: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/'))
                })
                


                (來自: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'))
                })
                

                推薦答案

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

                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.

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

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

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

                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 是一個流式"構建系統,因此您不能使用 uglify,除非您有某種機制將流轉換為緩沖區(并且當它完成時發出一個流.)您提到的兩種工具都可以實現這一點.

                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) > {對整個緩沖"文件執行一些工作} > STREAM > {其他 gulp 工作等}

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

                對于您的具體問題,您可以使用 .pipe() 因為vinyl-buffer/gulp-streamify 幫助將流轉換"為緩沖區,然后將緩沖區轉換為流".它們是完成本質上相同的事情的不同方法.

                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.

                這篇關于gulp中vinyl-buffer和gulp-streamify的目的是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='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'>

                        • 主站蜘蛛池模板: 韩国av一区二区 | 久久人体视频 | 久久精品小视频 | 一区中文字幕 | 成人免费视频网站在线看 | 国产一区二区影院 | 成人在线黄色 | 日韩欧美国产精品一区二区 | 亚洲狠狠 | 免费在线观看一区二区 | 欧美日韩成人在线 | 在线视频日韩 | 久久久综合精品 | 欧美成人精品一区二区男人看 | 亚洲一区二区三区欧美 | 日韩三级精品 | 国产精品永久免费视频 | 高清成人av | 亚洲综合第一页 | 免费黄视频网站 | 一级在线视频 | 中文字幕亚洲欧美 | 国产一区二区三区在线 | 欧美成人免费在线 | 欧美.com| 狠狠综合久久av一区二区老牛 | 天啪| 久久成人av电影 | 一区二区三区久久 | 成人国产精品久久 | 伊大人久久 | 精品三区 | 成人亚洲在线 | 亚洲一区二区三区视频 | 日韩欧美中文在线 | 久久国产一区二区三区 | 国产精品日产欧美久久久久 | 美女拍拍拍网站 | 久草免费在线视频 | 99国产精品99久久久久久 | 欧美一区二区三区视频在线播放 |