How to use the add-asset-html-webpack-plugin function in add-asset-html-webpack-plugin

To help you get started, we’ve selected a few add-asset-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 MorpheoOrg / morpheo-analytics / webpack / webpack.config.js View on Github external
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)];
};

add-asset-html-webpack-plugin

Add a JS or CSS assets to a generated HTML file

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis

Popular add-asset-html-webpack-plugin functions