How to use the @node-minify/utils.utils.compressSingleFile function in @node-minify/utils

To help you get started, we’ve selected a few @node-minify/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github srod / node-minify / packages / core / src / compress.js View on Github external
const compress = settings => {
  if (typeof settings.compressor !== 'function') {
    throw new Error(`compressor should be a function, maybe you forgot to install the compressor`);
  }

  createDirectory(settings.output);

  if (Array.isArray(settings.output)) {
    return settings.sync ? compressArrayOfFilesSync(settings) : compressArrayOfFilesAsync(settings);
  } else {
    return utils.compressSingleFile(settings);
  }
};