From 3a94deef696b6649fe358ae486e30d5e3c67cce2 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Wed, 29 Nov 2023 04:35:53 -0500 Subject: [PATCH] Fix minifying templates from dependencies (#18795) --- build-scripts/bundle.cjs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/build-scripts/bundle.cjs b/build-scripts/bundle.cjs index 79be54d4fb..18731af3d5 100644 --- a/build-scripts/bundle.cjs +++ b/build-scripts/bundle.cjs @@ -120,15 +120,21 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({ "template-html-minifier", { modules: { - lit: [ - "html", - { name: "svg", encapsulation: "svg" }, - { name: "css", encapsulation: "style" }, - ], + ...Object.fromEntries( + ["lit", "lit-element", "lit-html"].map((m) => [ + m, + [ + "html", + { name: "svg", encapsulation: "svg" }, + { name: "css", encapsulation: "style" }, + ], + ]) + ), + "@polymer/polymer/lib/utils/html-tag.js": ["html"], }, strictCSS: true, htmlMinifier: module.exports.htmlMinifierOptions, - failOnError: true, // we can turn this off in case of false positives + failOnError: false, // we can turn this off in case of false positives }, ], // Import helpers and regenerator from runtime package