bun-plugin-stx 0.2.136 → 0.2.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/serve.js +5 -1
- package/package.json +1 -1
package/dist/serve.js
CHANGED
|
@@ -10260,11 +10260,15 @@ ${html}`;
|
|
|
10260
10260
|
}
|
|
10261
10261
|
fragment = fragment.replace(/<script data-stx-scoped>\s*;?\(function\(\)\s*\{[\s\S]*?<\/script>/g, "");
|
|
10262
10262
|
const clearStale = "<script data-stx-page>if(window.stx)window.stx._latestSetup=null;</script>";
|
|
10263
|
+
const componentFactoryScripts = pageSetupScripts.filter((script) => script.includes("data-stx-component-factories"));
|
|
10264
|
+
const trailingPageScripts = pageSetupScripts.filter((script) => !script.includes("data-stx-component-factories"));
|
|
10263
10265
|
fragment = `${headStyles.join(`
|
|
10264
10266
|
`)}
|
|
10267
|
+
${componentFactoryScripts.join(`
|
|
10268
|
+
`)}
|
|
10265
10269
|
${fragment}
|
|
10266
10270
|
${clearStale}
|
|
10267
|
-
${
|
|
10271
|
+
${trailingPageScripts.join(`
|
|
10268
10272
|
`)}`;
|
|
10269
10273
|
const titleMatch = content.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
|
|
10270
10274
|
const pageTitle = titleMatch ? titleMatch[1].trim() : "";
|
package/package.json
CHANGED