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

    • <bdo id='roxaC'></bdo><ul id='roxaC'></ul>
    <tfoot id='roxaC'></tfoot>

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

      2. <small id='roxaC'></small><noframes id='roxaC'>

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

        Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌

        Browserify, Babel 6, Gulp - Unexpected token on spread operator(Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌)

            <tbody id='stKYw'></tbody>

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

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

                  <bdo id='stKYw'></bdo><ul id='stKYw'></ul>
                • 本文介紹了Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號..

                  我正在嘗試讓我的 Browserify/Babelify/Gulp 在我的項(xiàng)目中工作,但它不會使用擴(kuò)展運(yùn)算符.

                  I'm trying to get my Browserify/Babelify/Gulp working in my project, but it won't take the spread operator.

                  我從我的 gulpfile 中得到了這個(gè)錯(cuò)誤:

                  I got this error from my gulpfile:

                  [SyntaxError: /Users/mboutin2/Desktop/Todo-tutorial/src/reducers/grocery-list-reducers.js: Unexpected token (16:8) while parsing file: /Users/mboutin2/Desktop/Todo-tutorial/src/reducers/grocery-list-reducers.js]
                  

                  這是我的 gulpfile.js

                  This is my gulpfile.js

                  var gulp = require('gulp');
                  var source = require('vinyl-source-stream');
                  var browserify = require('browserify');
                  var sourcemaps = require('gulp-sourcemaps');
                  var uglify = require('gulp-uglify');
                  var buffer = require('vinyl-buffer');
                  var babelify = require('babelify');
                  
                  gulp.task('build', function () {
                    return browserify({entries: './src/client/app.js', extensions: ['.js'], debug: true})
                      .transform(babelify, {presets: ['es2015', 'react']})
                      .bundle()
                      .on('error', function (err) {
                        console.error(err);
                        this.emit('end');
                      })
                      .pipe(source('app.min.js'))
                      .pipe(buffer())
                      .pipe(sourcemaps.init({loadMaps: true}))
                      .pipe(uglify())
                      .pipe(sourcemaps.write('./'))
                      .pipe(gulp.dest('./public/js'));
                  });
                  
                  gulp.task('default', ['build']);
                  

                  我嘗試創(chuàng)建一個(gè) .babelrc 文件,但它做同樣的事情.當(dāng)我刪除傳播運(yùn)算符時(shí),我的腳本就可以工作了.

                  I tried to create a .babelrc file, but it do the same thing. And my script works when i delete the spread operator.

                  這是出現(xiàn) Unexpected token 的文件(很簡單).

                  This is the file where the Unexpected token occurs (quite simple).

                  import utils from '../utils/consts';
                  
                  const initialState = {
                    itemList: [
                      {name: 'Apple', type: 'Fruit'},
                      {name: 'Beef', type: 'Meat'}
                    ]
                  };
                  
                  export function groceryList(state = initialState, action = {}) {
                  
                    switch(action.type) {
                  
                      case utils.ACTIONS.ITEM_SUBMIT:
                        return {
                          ...state,
                          itemList: [
                            ...state.itemList,
                            {name: action.name, type: action.itemType}
                          ]
                        };
                  
                      default:
                        return state;
                  
                    }
                  }
                  

                  我不知道這有什么問題,我在 Github 和 Babel 網(wǎng)站上的設(shè)置頁面上閱讀了一些問題,但我無法使其正常工作.

                  I don't know what doesn't work in this, i read some issues on Github and the setup page on Babel website, but i can't make it work correctly.

                  誰能告訴我如何正確處理這個(gè)問題?謝謝

                  Can anyone show me how to handle this correctly? Thank you

                  推薦答案

                  該語法是未來的實(shí)驗(yàn)性提議語法,它不屬于 es2015react所以你需要啟用它.

                  That syntax is an experimental proposed syntax for the future, it is not part of es2015 or react so you'll need to enable it.

                  npm install --save-dev babel-plugin-transform-object-rest-spread
                  

                  并添加

                  "plugins": ["transform-object-rest-spread"]
                  

                  進(jìn)入 .babelrc 以及你現(xiàn)有的 presets.

                  into .babelrc alongside your existing presets.

                  或者:

                  npm install --save-dev babel-preset-stage-3
                  

                  并在您的預(yù)設(shè)中使用 stage-3 來啟用所有 stage-3 實(shí)驗(yàn)功能.

                  and use stage-3 in your presets to enable all stage-3 experimental functionality.

                  這篇關(guān)于Browserify,Babel 6,Gulp - 傳播運(yùn)算符上的意外令牌的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guā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 崩潰)
                  Detect FLASH plugin crashes(檢測 FLASH 插件崩潰)

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

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

                    <tfoot id='u1xq8'></tfoot>

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

                            主站蜘蛛池模板: 成人在线视频免费观看 | a级片网站| 狠狠躁18三区二区一区 | 精品欧美一区二区三区久久久小说 | 国产精品视频免费播放 | 精品毛片在线观看 | 国产精品福利视频 | 午夜精品久久久久久久99黑人 | 一区免费看 | 不卡欧美 | 毛片a | 热99| 91福利在线观看 | 久热久 | 日韩aⅴ视频 | 日韩欧美在线不卡 | 亚洲一区二区三区久久久 | 欧美中文字幕一区二区三区亚洲 | 国产精品美女久久久久久不卡 | 午夜99 | 成人a免费| 欧美伦理一区 | 成人做爰69片免费观看 | 欧美在线天堂 | 高清色| 在线免费av电影 | 国产日韩在线观看一区 | 亚洲一区精品视频 | 日韩在线成人 | 狠狠色香婷婷久久亚洲精品 | 亚洲性爰 | 在线免费观看毛片 | 九九久久精品 | 麻豆国产一区二区三区四区 | 中文区中文字幕免费看 | 久久久精品一区二区三区 | 欧美国产激情二区三区 | 久久久一区二区三区 | 九九热免费在线观看 | 久久久久久亚洲欧洲 | 亚洲国产欧美一区 |