code: function resolvePreset(preset) {
    let fn, options;
  
    if (Array.isArray(preset)) {
      fn = preset[0];
      options = preset[1];
    } else {
      fn = preset;
      options = {};
    }
  
    // For JS setups where we invoked the preset already
    if (preset.plugins) {
      return Promise.resolve(preset.plugins);
    }
  
    // Provide an alias for the default preset, as it is built-in.
    if (fn === 'default') {
      return Promise.resolve(require('cssnano-preset-default')(options).plugins);
    }
  
    // For non-JS setups; we'll need to invoke the preset ourselves.
    if (typeof fn === 'function') {
      return Promise.resolve(fn(options).plugins);
    }
  
    // Try loading a preset from node_modules
    if (isResolvable(fn)) {
      return Promise.resolve(require(fn)(options).plugins);
    }
  
    const sugar = `cssnano-preset-${fn}`;
  
    // Try loading a preset from node_modules (sugar)
    if (isResolvable(sugar)) {
      return Promise.resolve(require(sugar)(options).plugins);
    }
  
    // If all else fails, we probably have a typo in the config somewhere
    throw new Error(
      `Cannot load preset "${fn}". Please check your configuration for errors and try again.`
    );
  }
docs: /*
  preset can be one of four possibilities:
  preset = 'default'
  preset = ['default', {}]
  preset = function <- to be invoked
  preset = {plugins: []} <- already invoked function