spread/rest doesn't seem to work:
let foo = {somevar: 'test'}
let bar = {test: 'test'}
let baz = {...foo, ...bar}
browserify foo.js
foo.js:3
let baz = {...foo, ...bar}
^
ParseError: Unexpected token
Hi,
this issue is caused by underlying acorn parser which does not support this syntax feature currently.
Just now, you have tree choices how to solve this issue:
acorn supports this syntaxacorn with https://github.com/UXtemple/acorn-object-spreadbabylon as the parser under the hood: https://github.com/zdychacek/node-browserify. And then run this command: $ browserify-babylon src/app.js -o dist/out.js -t [ babelify ] --parser-plugins [ objectRestSpread ]
Most helpful comment
Hi,
this issue is caused by underlying
acornparser which does not support this syntax feature currently.Just now, you have tree choices how to solve this issue:
acornsupports this syntaxacornwithhttps://github.com/UXtemple/acorn-object-spreadbabylonas the parser under the hood: https://github.com/zdychacek/node-browserify. And then run this command:$ browserify-babylon src/app.js -o dist/out.js -t [ babelify ] --parser-plugins [ objectRestSpread ]