browserify / detective

Find all calls to require() no matter how deeply nested using a proper walk of the AST

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support ES6 imports

lukehorvat opened this issue · comments

Tried this:

import detective from 'detective';
import fs from 'fs';

let src = fs.readFileSync(__filename);
let requires = detective(src, { parse: { ecmaVersion: 6, sourceType: 'module' } });

console.log(requires);

Prints out [] instead of ['detective', 'fs']. Could we make detective support ES6 imports?

+1 for this!

That may be outside of the scope of this module. Try https://www.npmjs.com/package/detective-es6.

just made something similar https://github.com/egoist/konan