diff --git a/index.js b/index.js index 4f32876..9e67990 100644 --- a/index.js +++ b/index.js @@ -65,7 +65,11 @@ function precinct(content, options = {}) { let dependencies = []; if (detective) { - dependencies = detective(ast, options[type]); + dependencies = detective(ast, { + ...options[type], + filename: options.filename, + treePath: options.treePath + }); } else { debug('no detective found for: %s', type); } @@ -88,7 +92,7 @@ function precinct(content, options = {}) { * @return {String[]} */ precinct.paperwork = (filename, options = {}) => { - options = { includeCore: true, ...options }; + options = { includeCore: true, filename, ...options }; const fileSystem = options.fileSystem || fs; const content = fileSystem.readFileSync(filename, 'utf8');