|
|
@@ -1069,7 +1069,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
const rootDoc = this.doc;
|
|
|
const options = this.options;
|
|
|
const stats = this.stats;
|
|
|
- if (this.options.shadowRootsData) {
|
|
|
+ if (this.options.shadowRootsData && this.options.shadowRootsData.length) {
|
|
|
await processRootElement(this.doc);
|
|
|
const scriptElement = rootDoc.createElement("script");
|
|
|
scriptElement.textContent = `processNode(document);function processNode(node){node.querySelectorAll("[${WC_ATTRIBUTE_NAME}]").forEach(element=>{const shadowRoot=element.previousElementSibling.attachShadow({mode:"open"});shadowRoot.innerHTML=element.innerHTML;element.remove();processNode(shadowRoot)})}`;
|