We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal example:
gulpfile.js
const gulp = require('gulp'); const concat = require('gulp-concat'); const babel = require('gulp-babel'); gulp.task('nope', () => { return gulp .src('./nope.js') .pipe(babel({ presets: ['env'] }) .pipe(gulp.dest('transpiled'); });
nope.js
const y = Math.random() > 0.5; let x = { q: 1, ... y && { a: 2 } }
Running gulp nope produces following error:
gulp nope
throw er; // Unhandled 'error' event ^ SyntaxError: /directory/nope.js: Unexpected token (7:4) 5 | let x = { 6 | q: 1, > 7 | ... y && { a: 2 } | ^ 8 | } 9 | at Parser.pp$5.raise (/directory/node_modules/babylon/lib/index.js:4454:13) at Parser.pp.unexpected (/directory/node_modules/babylon/lib/index.js:1761:8) at Parser.pp$3.parseIdentifier (/directory/node_modules/babylon/lib/index.js:4332:10) at Parser.pp$3.parsePropertyName (/directory/node_modules/babylon/lib/index.js:4156:96) at Parser.pp$3.parseObj (/directory/node_modules/babylon/lib/index.js:4045:12) at Parser.pp$3.parseExprAtom (/directory/node_modules/babylon/lib/index.js:3719:19) at Parser.pp$3.parseExprSubscripts (/directory/node_modules/babylon/lib/index.js:3494:19) at Parser.pp$3.parseMaybeUnary (/directory/node_modules/babylon/lib/index.js:3474:19) at Parser.pp$3.parseExprOps (/directory/node_modules/babylon/lib/index.js:3404:19) at Parser.pp$3.parseMaybeConditional (/directory/node_modules/babylon/lib/index.js:3381:19)
My environment:
node -v v8.5.0 npm -v 5.5.1
node -v
npm -v
package.json.dependencies
"dependencies": { "babel-core": "^6.26.0", "babel-preset-env": "^1.6.1", "gulp": "^3.9.1", "gulp-babel": "^7.0.0" }
I created example on https://babeljs.io/repl.
The text was updated successfully, but these errors were encountered:
You are missing https://babeljs.io/docs/plugins/transform-object-rest-spread/. Spread in objects is not a standard feature yet.
Sorry, something went wrong.
This makes me very sad
can you
implement it
This is what did it for me:
npm install --save-dev babel-plugin-transform-object-rest-spread
Then, in package.json, I added the following babel configuration:
"babel": { "plugins": [ "transform-object-rest-spread" ] }
No branches or pull requests
Minimal example:
gulpfile.js
nope.js
Running
gulp nope
produces following error:My environment:
node -v
v8.5.0npm -v
5.5.1package.json.dependencies
I created example on https://babeljs.io/repl.
The text was updated successfully, but these errors were encountered: