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

Comments

Projects
None yet
@jampy

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 sokra added the enhancement label Oct 13, 2014

@sokra

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Oct 13, 2014

Member

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

Member

sokra commented Oct 13, 2014

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

@andreypopp

This comment has been minimized.

Show comment
Hide comment
@andreypopp

andreypopp Oct 24, 2014

Contributor

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

Contributor

andreypopp commented Oct 24, 2014

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

@syranide

This comment has been minimized.

Show comment
Hide comment
@syranide

syranide Oct 24, 2014

Contributor

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

Contributor

syranide commented Oct 24, 2014

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

@sokra

This comment has been minimized.

Show comment
Hide comment
@sokra
Member

sokra commented Jan 12, 2015

@kornelski

This comment has been minimized.

Show comment
Hide comment
@kornelski

kornelski Mar 26, 2015

👍 I'd like to use ES6 output too.

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

kornelski commented Mar 26, 2015

👍 I'd like to use ES6 output too.

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

@sokra

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Mar 26, 2015

Member

This should work in the webpack-2 branch

Member

sokra commented Mar 26, 2015

This should work in the webpack-2 branch

@jhnns

This comment has been minimized.

Show comment
Hide comment
@jhnns

jhnns Mar 27, 2015

Member

@pornel webpack-2 is using acorn.

Member

jhnns commented Mar 27, 2015

@pornel webpack-2 is using acorn.

@Sinewyk

This comment has been minimized.

Show comment
Hide comment
@Sinewyk

Sinewyk 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 ?

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

This comment has been minimized.

Show comment
Hide comment
@remimarenco

remimarenco commented May 26, 2015

👍

@dbrans

This comment has been minimized.

Show comment
Hide comment
@dbrans

dbrans Jul 1, 2015

Hi, has anyone found a solution/workaround?
Cheers

dbrans commented Jul 1, 2015

Hi, has anyone found a solution/workaround?
Cheers

@sokra

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Jul 1, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya 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.

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

This comment has been minimized.

Show comment
Hide comment
@sokra

sokra Aug 10, 2015

Member

@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.

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

This comment has been minimized.

Show comment
Hide comment
@XeCycle

XeCycle 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.

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