( tags: HtmlTagDescriptor[], ctx: IndexHtmlTransformContext, )
| 1417 | ]) |
| 1418 | |
| 1419 | function headTagInsertCheck( |
| 1420 | tags: HtmlTagDescriptor[], |
| 1421 | ctx: IndexHtmlTransformContext, |
| 1422 | ) { |
| 1423 | if (!tags.length) return |
| 1424 | const { logger } = ctx.server?.config || {} |
| 1425 | const disallowedTags = tags.filter( |
| 1426 | (tagDescriptor) => !elementsAllowedInHead.has(tagDescriptor.tag), |
| 1427 | ) |
| 1428 | |
| 1429 | if (disallowedTags.length) { |
| 1430 | const dedupedTags = unique( |
| 1431 | disallowedTags.map((tagDescriptor) => `<${tagDescriptor.tag}>`), |
| 1432 | ) |
| 1433 | logger?.warn( |
| 1434 | colors.yellow( |
| 1435 | colors.bold( |
| 1436 | `[${dedupedTags.join(',')}] can not be used inside the <head> Element, please check the 'injectTo' value`, |
| 1437 | ), |
| 1438 | ), |
| 1439 | ) |
| 1440 | } |
| 1441 | } |
| 1442 | |
| 1443 | export async function applyHtmlTransforms( |
| 1444 | html: string, |
no test coverage detected