browserify / detective

Find all calls to require() no matter how deeply nested using a proper walk of the AST
Other
414 stars 61 forks source link

Support ES6 imports #56

Open lukehorvat opened 9 years ago

lukehorvat commented 9 years ago

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?

tnrich commented 9 years ago

+1 for this!

mrjoelkemp commented 8 years ago

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

egoist commented 7 years ago

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