Open catest opened 7 years ago
Yes currently ES6 doesn't work.
Related: https://twitter.com/Kikobeats/status/777872609530740736
Definitely I need charliedowler's help for resolve this 😄 .
Hi,
I switched back to esprima and tried sourceType as you suggested. Imports won't work until this function is rewritten
astw(ast)(function(node) {
if (!isRequire(node)) return
It's looking for require statements instead of both require and import, I don't think upgrading node-resolver
to fully support es6 is as simple as bumping the esprima dependency.
What do you think?
Cheers, Charlie
Actually I don't know how to walk into the AST. If you feel confortable doing that I can add you as collaborator 😁
Hey,
I released a new patch version. I switch the package used for parsing the AST. Looks like we are near to get this working!
The current limitation is how to detect import
.
This libraries uses https://github.com/hughsk/is-require/blob/master/index.js that very basic and it depends of the node that you pass.
I isolate the case in a little example: https://gist.github.com/Kikobeats/89168d73f57fd8e6c17c0effe1403987
[Enter steps to reproduce below:]
Atom Version: 1.10.2 Electron Version: 0.37.8 System: Mac OS X 10.11.6 Thrown From: node-resolver2 package, v2.0.1
Stack Trace
Uncaught Error: Line 1: Illegal import declaration
Commands
Config
Installed Packages