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

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

    • <bdo id='kIRup'></bdo><ul id='kIRup'></ul>
    <legend id='kIRup'><style id='kIRup'><dir id='kIRup'><q id='kIRup'></q></dir></style></legend>

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

    1. <tfoot id='kIRup'></tfoot>

      gulp babel,未定義導出

      gulp babel, exports is not defined(gulp babel,未定義導出)

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

              <tbody id='4p9e2'></tbody>
            <legend id='4p9e2'><style id='4p9e2'><dir id='4p9e2'><q id='4p9e2'></q></dir></style></legend>
              <bdo id='4p9e2'></bdo><ul id='4p9e2'></ul>
              <tfoot id='4p9e2'></tfoot>

                本文介紹了gulp babel,未定義導出的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                考慮以下示例代碼(也許我做錯了?)

                Consider the following example code (and maybe I am doing it wrong?)

                 var FlareCurrency = {
                
                 };
                
                export {FlareCurrency};
                

                我有以下任務:

                gulp.task("compile:add-new-currency-minified", function(){
                  return gulp.src('src/add-new-currency/**/*.js')
                             .pipe(babel())
                             .pipe(concat('Flare-AddNewCurrency.js'))
                             .pipe(uglify({"preserveComments": "all"}))
                             .pipe(gulp.dest('dist/minified/'));
                });
                

                當我運行它時,我得到以下信息:

                When I run this I get the following:

                "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var FlareCurrency={};exports.FlareCurrency=FlareCurrency;
                

                為了好玩,我想在控制臺中運行它,是的,我知道它什么也沒做,但我沒想到會看到這個:

                For the fun of it, I wanted to run it in the console, yes I know it does nothing but I didn't expect to see this:

                Uncaught ReferenceError: exports is not defined(…)
                

                非縮小版:

                "use strict";
                
                Object.defineProperty(exports, "__esModule", {
                  value: true
                });
                var FlareCurrency = {};
                
                exports.FlareCurrency = FlareCurrency;
                

                拋出同樣的錯誤.想法?

                推薦答案

                這實際上不是 babel 問題,您只是嘗試在瀏覽器中運行 CommonJS 代碼(從 ES6 export 轉譯)準備.CommonJS 不在瀏覽器上運行,需要使用工具為瀏覽器打包,例如 Webpack 或 瀏覽器.

                That is not actually a babel issue, you are just trying to run CommonJS code (transpiled from ES6 export) in the browser without preparation. CommonJS doesn't run on the browser, you need to use a tool to package it for the browser, such as Webpack or Browserify.

                本周巧合的是,我在 Github 上創建了一個小項目,展示了 Gulp + ES6 代碼(使用 export)+ Babel + Webpack 的設置:gulp-es6-webpack-example.

                Just by coincidence this week I created a small project on Github that shows a setup of Gulp + ES6 code (using export) + Babel + Webpack: gulp-es6-webpack-example.

                在我的示例中,您可以在瀏覽器上同步(預加載)或異步(延遲加載)加載 JS 代碼.

                In my example you can load JS code on the browser either synchronously (pre-loaded) or asynchronously (lazy-loaded).

                這篇關于gulp babel,未定義導出的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)
              • <legend id='r5xQA'><style id='r5xQA'><dir id='r5xQA'><q id='r5xQA'></q></dir></style></legend>
                    <tbody id='r5xQA'></tbody>

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

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

                          主站蜘蛛池模板: 龙珠z在线观看 | 久久久久久久久国产精品 | 欧美午夜视频 | 久久久久久久一区二区 | 欧美一区2区三区3区公司 | 日本精品视频一区二区三区四区 | 久久国产精品首页 | 操操日| 一级久久久久久 | 日韩在线视频一区二区三区 | 欧美日韩精品区 | 国产精品久久久久久婷婷天堂 | 欧美成人激情视频 | 九九久久精品视频 | 亚洲a一区二区 | 黄色片免费| 天天看天天干 | 99久久久久久99国产精品免 | 久久精品视频一区二区三区 | 亚洲精品在线播放 | 成人a视频 | 狠狠干综合视频 | 日本久久福利 | 中文字幕av一区二区三区 | 欧美综合在线视频 | 日本午夜网| zzzwww在线看片免费 | 国产午夜精品视频 | 91在线精品播放 | 999热精品| 亚洲成人一区 | 欧美国产日韩一区二区三区 | 亚洲国产情侣自拍 | 在线观看第一区 | 91在线区| 午夜精品久久久久久久星辰影院 | 国产福利在线视频 | 日韩精品在线网站 | 91精品国产综合久久久久久丝袜 | 超碰av人人| 青青草综合网 |