code: function resolveConfig(css, result, options) {
    if (options.preset) {
      return resolvePreset(options.preset);
    }
  
    const inputFile = css.source && css.source.input && css.source.input.file;
    let searchPath = inputFile ? path.dirname(inputFile) : process.cwd();
    let configPath = null;
  
    if (options.configFile) {
      searchPath = null;
      configPath = path.resolve(process.cwd(), options.configFile);
    }
  
    const configExplorer = cosmiconfig(cssnano);
    const searchForConfig = configPath
      ? configExplorer.load(configPath)
      : configExplorer.search(searchPath);
  
    return searchForConfig.then((config) => {
      if (config === null) {
        return resolvePreset('default');
      }
  
      return resolvePreset(config.config.preset || config.config);
    });
  }
docs: /*
  cssnano will look for configuration firstly as options passed
  directly to it, and failing this it will use cosmiconfig to
  load an external file.