module-deps icon indicating copy to clipboard operation
module-deps copied to clipboard

Chokes on ES6 modules.

Open anandthakker opened this issue 9 years ago • 6 comments

Currently, running module-deps on source with ES6 module syntax throws Error: Parsing file /blah/dee/dah.js 'import' and 'export' may appear only with 'sourceType: module' (4:0).

The reason for this is that acorn, via detective, needs a {ecmaVersion: 6, sourceType: 'module'}, but currently, there's no way to pass those options through.
#63 would address this, although it would only be a superficial fix: module-deps still wouldn't actually traverse ES6 modules. I'm assuming ES6 modules are out of scope here?

Also: anything I could do to help get #63 merged?

anandthakker avatar Jul 01 '15 01:07 anandthakker

Actually, note that the custom detective thing only addresses this after upstream https://github.com/substack/node-detective/issues/54 is fixed.

anandthakker avatar Jul 01 '15 01:07 anandthakker

@anandthakker To clarify the traversing the ES6 modules point: it's outside the scope of Browserify until Node does it.

terinjokes avatar Jul 01 '15 06:07 terinjokes

@terinjokes :+1: makes sense.

anandthakker avatar Jul 01 '15 10:07 anandthakker

Hey! I think time has come ;)

glukki avatar Feb 08 '16 21:02 glukki

@glukki Node still does not support ES6 Modules. Browserify is an implementation of the Node module system for the web. With that in mind, it can't implement a module system that Node itself does not.

terinjokes avatar Feb 09 '16 05:02 terinjokes

@terinjokes sorry, my bad. I thought that node v5 already has import implemented :(

glukki avatar Feb 14 '16 22:02 glukki