diff --git a/src/stylemark.js b/src/stylemark.js index 68b4d2e..63dd400 100644 --- a/src/stylemark.js +++ b/src/stylemark.js @@ -33,7 +33,7 @@ function generate(params) { options.output = output; options.match = options.match || defaultMatchExtensions; options.excludeDir = defaultExcludeDirectories.concat(options.excludeDir); - options.baseDir = options.baseDir ? findRoot(path.resolve(options.baseDir)) : findRoot(process.cwd()); + options.baseDir = options.baseDir ? findRoot(path.resolve(options.baseDir)) : findRoot(configPath); ['match', 'excludeDir'].forEach(name => { options[name] = _.isString(options[name]) ? new RegExp(options[name]) : options[name];