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

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

    • <bdo id='7XCbt'></bdo><ul id='7XCbt'></ul>

    <small id='7XCbt'></small><noframes id='7XCbt'>

    <tfoot id='7XCbt'></tfoot>

      Gulp + babelify + browserify 問題

      Gulp + babelify + browserify issue(Gulp + babelify + browserify 問題)

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

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

                本文介紹了Gulp + babelify + browserify 問題的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

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

                我正在嘗試使用 browserify 和 babelify 創(chuàng)建一個(gè) gulp 任務(wù).這是任務(wù):

                I'm trying to create a gulp task with browserify and babelify. Here is the task:

                var gulp = require('gulp');
                var browserify = require('gulp-browserify');
                var source = require('vinyl-source-stream');
                var babelify = require('babelify');
                
                gulp.task('js', function () {
                    browserify('./resources/js/*.js')
                        .transform(babelify)
                        .bundle()
                        .pipe(source('*.js'))
                        .pipe(gulp.dest('./public/js'));
                });
                

                我找到了一些示例代碼,嘗試使用它們,但結(jié)果總是一樣.

                I found a few sample code, tried to use them, but the result was always the same.

                當(dāng)我運(yùn)行任務(wù)并保存我的 example.js 文件時(shí),出現(xiàn)以下錯(cuò)誤:

                When i run the task, and save my example.js file, the following error occurs:

                TypeError: browserify(...).transform 不是函數(shù)

                我做錯(cuò)了什么?

                推薦答案

                你混淆了 browserifygulp-browserify 的 API.

                You're mixing up the API for browserify and gulp-browserify.

                從 gulp-browserify docs,您需要執(zhí)行以下操作:

                From the gulp-browserify docs, you'll want to do something like this:

                var gulp = require('gulp')
                var browserify = require('gulp-browserify')
                
                gulp.task('js', function () {
                  gulp.src('./resources/js/*.js')
                    .pipe(browserify({
                      transform: ['babelify'],
                    }))
                    .pipe(gulp.dest('./public/js'))
                });
                

                <小時(shí)>

                自從第一次回答這個(gè)問題以來,gulp-browserify 已被放棄 并且 gulp 已經(jīng)發(fā)展了很多.如果您想使用更新版本的 gulp 實(shí)現(xiàn)相同的功能,您可以 遵循 gulp 團(tuán)隊(duì)提供的指南.


                Since this question was first answered, gulp-browserify has been abandoned and gulp has evolved a great deal. If you'd like to achieve the same thing with a newer version of gulp, you can follow the guides provided by the gulp team.

                你最終會(huì)得到如下的結(jié)果:

                You'll end up with something like the following:

                var browserify = require('browserify');
                var babelify = require('babelify');
                var gulp = require('gulp');
                var source = require('vinyl-source-stream');
                var buffer = require('vinyl-buffer');
                var sourcemaps = require('gulp-sourcemaps');
                var util = require('gulp-util');
                
                gulp.task('default', function () {
                  var b = browserify({
                    entries: './resources/test.js',
                    debug: true,
                    transform: [babelify.configure({
                      presets: ['es2015']
                    })]
                  });
                
                  return b.bundle()
                    .pipe(source('./resources/test.js'))
                    .pipe(buffer())
                    .pipe(sourcemaps.init({ loadMaps: true }))
                      // Add other gulp transformations (eg. uglify) to the pipeline here.
                      .on('error', util.log)
                    .pipe(sourcemaps.write('./'))
                    .pipe(gulp.dest('./public/js/'));
                });
                

                這篇關(guān)于Gulp + babelify + browserify 問題的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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(打開 Javascript 文件時(shí) Visual Studio 2015 崩潰)

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

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

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

                          主站蜘蛛池模板: 亚洲天堂av在线 | 精品久久久久久久 | 黄色一级在线播放 | 久久久久久电影 | 久久艹免费视频 | 色毛片| 综合久久99 | 在线成人免费观看 | 国产成人精品免费视频大全最热 | 欧美色a v| 国产精品久久网 | 亚洲国产成人精品女人久久久 | 九九综合 | 欧美福利 | 一区二区三区视频在线观看 | 第一av| 国产精品久久久久久久久久久久久 | 亚洲天堂精品久久 | 亚洲成人国产精品 | 午夜成人免费视频 | 午夜男人的天堂 | 国产精品日韩一区二区 | 国产网站在线播放 | 亚洲一区中文字幕在线观看 | 日韩精品一区二区三区久久 | 日韩a视频 | 日韩av免费在线电影 | 国产精品视频一区二区三区四区国 | 天天草狠狠干 | 欧美国产精品一区二区三区 | 国产精品一区二区电影 | 久久国产精品免费一区二区三区 | 国产精品一区二区三区在线 | 九九色综合 | 国内自拍真实伦在线观看 | 亚洲av一级毛片 | 久久久av一区 | 国产 亚洲 网红 主播 | 一区二区三区精品视频 | 欧美一级在线 | 成人免费看黄网站在线观看 |