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

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

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

        <bdo id='gYgOp'></bdo><ul id='gYgOp'></ul>
    1. <legend id='gYgOp'><style id='gYgOp'><dir id='gYgOp'><q id='gYgOp'></q></dir></style></legend>
      <tfoot id='gYgOp'></tfoot>

        SyntaxError: 'import' 和 'export' 可能只出

        SyntaxError: #39;import#39; and #39;export#39; may appear only with #39;sourceType: module#39; - Gulp(SyntaxError: import 和 export 可能只出現在 sourceType: module 中 - Gulp)

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

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

              <legend id='DYbqj'><style id='DYbqj'><dir id='DYbqj'><q id='DYbqj'></q></dir></style></legend>

                <bdo id='DYbqj'></bdo><ul id='DYbqj'></ul>
                  <tfoot id='DYbqj'></tfoot>
                  本文介紹了SyntaxError: 'import' 和 'export' 可能只出現在 'sourceType: module' 中 - Gulp的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  考慮以下兩個文件:

                  app.js

                  import Game       from './game/game';
                  import React      from 'react';
                  import ReactDOM   from 'react-dom';
                  
                  export default (absPath) => {
                    let gameElement = document.getElementById("container");
                  
                    if (gameElement !== null) {
                        ReactDOM.render(
                            <Game mainPath={absPath} />,
                            gameElement
                        );
                    }
                  }
                  

                  index.js

                  import App from './src/app';
                  

                  gulpfile.js

                  var gulp        = require('gulp');
                  var source      = require('vinyl-source-stream');
                  var browserify  = require('browserify');
                  var babelify    = require("babelify");
                  var watch       = require('gulp-watch');
                  
                  gulp.task('make:game', function(){
                    return browserify({
                      entries: [
                        'index.js'
                      ]
                    })
                    .transform('babelify')
                    .bundle()
                    .pipe(source('index.js'))
                    .pipe(gulp.dest('app/'));
                  });
                  

                  錯誤:

                  gulp make:game
                  [13:09:48] Using gulpfile ~/Documents/ice-cream/gulpfile.js
                  [13:09:48] Starting 'make:game'...
                  
                  events.js:154
                        throw er; // Unhandled 'error' event
                        ^
                  SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'
                  

                  這是什么錯誤?我做錯了什么?

                  推薦答案

                  舊版本的 Babel 提供了開箱即用的一切.較新的版本要求您安裝安裝所需的任何插件.首先,您需要安裝 ES2015 預設.

                  Older versions of Babel came with everything out of the box. The newer version requires you install whichever plugins your setup needs. First, you'll need to install the ES2015 preset.

                  npm install babel-preset-es2015 --save-dev
                  

                  接下來,你需要告訴 babelify 使用你安裝的預設.

                  Next, you need to tell babelify to use the preset you installed.

                  return browserify({ ... })
                    .transform(babelify.configure({
                      presets: ["es2015"]
                    }))
                    ...
                  

                  來源

                  這篇關于SyntaxError: 'import' 和 'export' 可能只出現在 'sourceType: module' 中 - Gulp的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 崩潰)

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

                      • <legend id='ziUNr'><style id='ziUNr'><dir id='ziUNr'><q id='ziUNr'></q></dir></style></legend>

                          <tfoot id='ziUNr'></tfoot>
                        1. <small id='ziUNr'></small><noframes id='ziUNr'>

                            <tbody id='ziUNr'></tbody>
                            主站蜘蛛池模板: 一级大片网站 | 一区二区三区 在线 | 成人夜晚看av | 欧美视频网 | www.欧美.com| 亚洲色欧美另类 | 夜夜爽99久久国产综合精品女不卡 | 欧美色综合一区二区三区 | 狠狠天天| 精品久久一 | 亚洲福利在线观看 | 亚洲精品9999久久久久 | 99精品福利视频 | 久久久做| 无人区国产成人久久三区 | 欧美色综合一区二区三区 | 香蕉久久av | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 精品免费国产一区二区三区四区 | 精品国产1区2区3区 一区二区手机在线 | 久草在线免费资源 | 99re免费| 日本成人在线观看网站 | 97起碰| 日韩精品一区二区三区四区 | 精品国产一区二区在线 | 欧美国产精品久久久 | 日日干夜夜操 | 人人干人人干人人 | 久久久www成人免费无遮挡大片 | 欧美精品成人一区二区三区四区 | 欧美国产精品久久久 | 欧美性猛交一区二区三区精品 | 日韩av电影在线观看 | 伊人无码高清 | 精品国产一区二区三区久久久蜜月 | 射久久| 欧美成人一区二区三区 | 国产高清一区二区三区 | 黄网站在线播放 | 毛片免费看的 |