How to use the html-webpack-plugin/lib/chunksorter.dependency function in html-webpack-plugin

To help you get started, we’ve selected a few html-webpack-plugin 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 blackbaud / skyux-builder / utils / host-utils.js View on Github external
function getScripts(chunks) {
  let scripts = [];

  // Used when skipping the build, short-circuit to return metadata
  if (chunks.metadata) {
    return chunks.metadata;
  }

  sorter.dependency(chunks).forEach((chunk) => {
    scripts.push({
      name: chunk.files[0]
    });
  });

  return scripts;
}