Skip to content
New issue

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

trouble with spread operator #78

Closed
lionkeng opened this issue Jun 12, 2015 · 2 comments
Closed

trouble with spread operator #78

lionkeng opened this issue Jun 12, 2015 · 2 comments

Comments

@lionkeng
Copy link

Hi there. Need some help with transpiling a spread operator.
I have code that looks like this:

    var {
      style,
      useContent,
      contentType,
      contentStyle,
      ...other
    } = this.props;

with jsx-loader?harmony, webpack happily transpiles. But with babel-loader, I am getting an error that looks like this:

ERROR in ./app/jsx/components/fullwidth-section.jsx
Module build failed: SyntaxError: /Users/keng/work/virtuosityworks/aubusson/app/jsx/components/fullwidth-section.jsx: Unexpected token (54:6)
52 | contentType,
53 | contentStyle,
`> 54 | ...other
| ^
55 | } = this.props;
56 |

My module config for babel-loader looks like this:

 { test: /\.jsx?$/, loaders: ['babel-loader'], exclude: /node_modules/},
@hzoo
Copy link
Member

hzoo commented Jun 12, 2015

I think you need babel-loader?stage=1 (experimental features) and you should be good. https://github.com/sebmarkbage/ecmascript-rest-spread

@lionkeng
Copy link
Author

@hzoo Thanks! that worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants