Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const AddAssetHtmlPlugins = () => {
const arr = [];
for (let i = 0, l = DllArray.length; i < l; i++) {
if (!fs.existsSync(`./build/dll${!PRODUCTION ? '-dev' : ''}/${DllArray[i]}.dll.js`)) {
console.error(`The DLL is missing. Please run \`npm run dll${!PRODUCTION ? ':dev' : ''}\``);
process.exit(0);
}
else {
arr.push({
filepath: require.resolve(`../build/dll${!PRODUCTION ? '-dev' : ''}/${DllArray[i]}.dll.js`),
//hash: true, // can break prod
});
}
}
return [new AddAssetHtmlPlugin(arr)];
};