Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Enable ES2017 #27

Merged
merged 2 commits into from
Jul 18, 2017
Merged

Enable ES2017 #27

merged 2 commits into from
Jul 18, 2017

Conversation

fregante
Copy link
Contributor

@fregante fregante commented Jul 7, 2017

This should enable async/await support. es2017 has been recently finalized and published.

@fregante
Copy link
Contributor Author

fregante commented Jul 7, 2017

Actually I tested this and for whatever reason this still doesn't work :(

ERROR in ./src/content.js
Module build failed: SyntaxError: Unexpected token (147:6)
    at Parser.pp$4.raise (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp.semicolon (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:581:61)
    at Parser.pp$1.parseExpressionStatement (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:966:10)
    at Parser.pp$1.parseStatement (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:730:24)
    at Parser.pp$1.parseTopLevel (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:638:25)
    at Parser.parse (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:516:17)
    at Object.parse (./node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js:3098:39)
    at Object.nativejsx.transpile (./node_modules/nativejsx/source/nativejsx.js:103:21)
    at Object.module.exports (./node_modules/nativejsx-loader/index.js:10:15)

I tried passing it as an option but, while it's picked up, acorn pushes out that error.

	module: {
		rules: [
			{
				test: /\.js$/,
				exclude: /node_modules/,
				use: {
					loader: 'nativejsx-loader',
					options: {
						variablePrefix: '_',
						acorn: {
							ecmaVersion: 8,
							sourceType: 'module',
							plugins: {jsx: true},
						}
					}
				}
			}
		]
	}

@fregante
Copy link
Contributor Author

fregante commented Jul 7, 2017

I think this is due to acorn-jsx 3 and acorn 4. Both need to be +1'd

@fregante fregante changed the title Switch to es2017 Enable ES2017 Jul 7, 2017
@treycordova
Copy link
Owner

Thanks for the upgrade, @bfred-it.

@treycordova treycordova merged commit 1fe3499 into treycordova:master Jul 18, 2017
@fregante fregante deleted the patch-1 branch July 18, 2017 01:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants