Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
}