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

Add support for ES6 features #532

Closed
jampy opened this issue Oct 13, 2014 · 14 comments
Closed

Add support for ES6 features #532

jampy opened this issue Oct 13, 2014 · 14 comments

Comments

@jampy
Copy link

jampy commented Oct 13, 2014

Currently webpack seems to fail parsing JavaScript code that contains ES6 syntax like generators.

Module parse failed: ..../main.js Line 20: Unexpected token *
You may need an appropriate loader to handle this file type.
| }
| 
| function * ex_test() {
|   throw new Error("work!");
| }

Could you please adjust the static code analysis so that it doesn't break with code that uses generators?

I'm trying to use generators natively in browsers that support them, so don't want to use a transpiler in this case..

@sokra
Copy link
Member

sokra commented Oct 13, 2014

We can do this once esprima 2.0 is published...

@andreypopp
Copy link
Contributor

esprima-fb package can be used instead as it provides es6 features and is robust (used by Facebook for JSX toolchain).

@syranide
Copy link
Contributor

@andreypopp Aren't all the non-JSX features of esprima-fb part of the esprima harmony branch?

@sokra
Copy link
Member

sokra commented Jan 12, 2015

#683

@kornelski
Copy link

👍 I'd like to use ES6 output too.

Esprima 2 is now available and Webpack tests pass with 2.1.0.

@sokra
Copy link
Member

sokra commented Mar 26, 2015

This should work in the webpack-2 branch

@jhnns
Copy link
Member

jhnns commented Mar 27, 2015

@pornel webpack-2 is using acorn.

@Sinewyk
Copy link

Sinewyk commented Apr 19, 2015

Any news on this ? Is there a way to hack it to let webpack just pass through es6 code, and let the developer the responsibility to send supported code to wherever ?

@remimarenco
Copy link

👍

@dbrans
Copy link

dbrans commented Jul 1, 2015

Hi, has anyone found a solution/workaround?
Cheers

@sokra
Copy link
Member

sokra commented Jul 1, 2015

You can use the webpack-2 branch. It is using a ES6 parser (acorn) and understands import export and System.import.

@ariya
Copy link

ariya commented Aug 2, 2015

@sokra I experimented with bumping the dependencies (package.json) to Esprima 2.5, ran npm test and so far nothing breaks the tests. This is the easiest to allow webpack to consume ES6 code.
Is this something that is desireable? If yes, I can create a PR.

@sokra
Copy link
Member

sokra commented Aug 10, 2015

@sokra I experimented with bumping the dependencies (package.json) to Esprima 2.5, ran npm test and so far nothing breaks the tests. This is the easiest to allow webpack to consume ES6 code.
Is this something that is desireable? If yes, I can create a PR.

I've bumped it for 1.12... Let's see how this works out.

@XeCycle
Copy link

XeCycle commented Aug 26, 2015

1.12 is working for my project (babel blacklist regenerator), and tests passed, though very low coverage. Maybe this can be closed, if no need for further confirmations.

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

No branches or pull requests