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

Import statements won't work #5

Open
mgoldwater-nisum-com opened this issue Aug 27, 2017 · 2 comments
Open

Import statements won't work #5

mgoldwater-nisum-com opened this issue Aug 27, 2017 · 2 comments
Labels

Comments

@mgoldwater-nisum-com
Copy link

My package.json

"jest": { "resolver": "jest-webpack-resolver", "transform": { "^.+\\.jsx?$": "babel-jest" } }

My test script is just "test": "jest"

My error message comes from my webpack config and states: import path from 'path'; SyntaxError: Unexpected token import

@mkg0
Copy link
Owner

mkg0 commented Aug 27, 2017

ES modules are not supported in Node and as expected I did not provide any solution for parsing this module types.
I think you should prefer commonjs modules in webpack configuration.

@MattGoldwater
Copy link

It's not a huge deal, but I prefer to use import statements everywhere to keep my code more consistent and do less context switching. What's your reasoning for preferring commonjs modules in Webpack configs?

Also, I presume plenty of people are using import statements through Babel and std/esm could become popular.

@mkg0 mkg0 added the rejected label Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants