MarkdownExtractor.prototype.configure = function()

in packages/docpack-markdown-extractor/lib/plugin.js [31:56]


MarkdownExtractor.prototype.configure = function(compiler) {
  var config = this.config;
  var files;

  if (typeof config.files == 'string') {
    files = glob.sync(path.resolve(compiler.context, config.files), {absolute: true});

    if (!files.length) {
      this.emitError('No markdown files found');
    }
  } else if (Array.isArray(config.files)) {
    files = config.files.map(function(filepath) {
      return path.resolve(compiler.context, filepath);
    });
  }

  this.files = files;

  var nullLoaderPath = require.resolve('null-loader');

  files.forEach(function(filepath) {
    var request = tools.stringifyLoaderRequest(nullLoaderPath, null, filepath);
    var entryName = path.relative(compiler.context, filepath);
    tools.addEntry(compiler, request, entryName);
  });
};