@zenithbuild/core 1.2.3 → 1.2.7

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.
@@ -252,13 +252,15 @@ export async function dev(options: DevOptions = {}): Promise<void> {
252
252
  */
253
253
  async function generateDevHTML(page: CompiledPage): Promise<string> {
254
254
  // Single neutral injection point
255
- const runtimeTag = `<script src="/runtime.js"></script>`
255
+ const runtimeTag = `<script type="module" src="/runtime.js"></script>`
256
256
  const scriptTag = `<script type="module">\n${page.script}\n</script>`
257
257
  const allScripts = `${runtimeTag}\n${scriptTag}`
258
258
 
259
- let html = page.html.includes('</body>')
260
- ? page.html.replace('</body>', `${allScripts}\n</body>`)
261
- : `${page.html}\n${allScripts}`
259
+ let html = page.html.includes('</head>')
260
+ ? page.html.replace('</head>', `${allScripts}\n</head>`)
261
+ : page.html.includes('</body>')
262
+ ? page.html.replace('</body>', `${allScripts}\n</body>`)
263
+ : `${page.html}\n${allScripts}`
262
264
 
263
265
  // Ensure DOCTYPE is present to prevent Quirks Mode (critical for SVG namespace)
264
266
  if (!html.trimStart().toLowerCase().startsWith('<!doctype')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenithbuild/core",
3
- "version": "1.2.3",
3
+ "version": "1.2.7",
4
4
  "description": "Core library for the Zenith framework",
5
5
  "license": "MIT",
6
6
  "type": "module",