UNPKG

html-bundler-webpack-plugin

Version:

Generates complete single-page or multi-page website from source assets. Built-in support for Markdown, Eta, EJS, Handlebars, Nunjucks, Pug. Alternative to html-webpack-plugin.

37 lines (29 loc) 1.16 kB
const { greenBright, redBright, reset, black } = require('ansis'); const { outToConsole } = require('../../Common/Helpers'); const Config = require('../../Common/Config'); const { pluginLabel } = Config.get(); const headerWarning = `\n${reset.black.bgYellow` ${pluginLabel} ${black.bg(227)` WARNING `}`}\n`; const optionSplitChunksChunksAllWarning = () => { const message = `DO NOT use the ${redBright`chunks: 'all'`} option globally! The ${redBright`splitChunks.chunks`} option is automatically deleted, because it corrupts output files generated by this plugin! ${black.bgYellowBright` SOLUTION `} Define the ${greenBright`chunks`} option in ${greenBright`'splitChunks.cacheGroups.{group}.chunks'`}, e.g.: splitChunks: { ${redBright`- chunks: 'all',`} // <= DO NOT use this here cacheGroups: { myGroup: { test: /\\.(js|ts)$/, // <= IMPORTANT: split only script files ${greenBright`+ chunks: 'all',`} // <= DEFINE it here only }, }, }, `; outputWarning(message); }; const outputWarning = (message) => { outToConsole(headerWarning + message); }; module.exports = { outputWarning, optionSplitChunksChunksAllWarning, };