@cloudwerk/vite-plugin 0.6.8 → 0.6.9

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -481,7 +481,7 @@ async function renderWithHydration(element, status = 200, routeId, pageProps, la
481
481
  let scripts = VITE_CLIENT
482
482
  ${rendererName === "react" ? `// React: embed serialized page data for full-tree hydration
483
483
  if (routeId) {
484
- const pageData = JSON.stringify({ routeId, pageProps: pageProps || {}, layoutData: layoutData || [] })
484
+ const pageData = JSON.stringify({ routeId, pageProps: pageProps || {}, layoutData: layoutData || [] }).replace(/</g, '\\\\u003c')
485
485
  scripts += '<script id="__CLOUDWERK_DATA__" type="application/json">' + pageData + '</script>'
486
486
  }` : ""}
487
487
  scripts += '<script type="module" src="${clientEntryPath}"></script>'
@@ -1319,7 +1319,7 @@ ${cssImportStatements}console.debug('[Cloudwerk] No route manifest available for
1319
1319
  layoutVars.push(importedLayouts.get(layoutPath));
1320
1320
  }
1321
1321
  routeMapEntries.push(
1322
- ` '${route.urlPattern}': { page: ${pageVar}.default, layouts: [${layoutVars.map((v) => `${v}.default`).join(", ")}] }`
1322
+ ` ${JSON.stringify(route.urlPattern)}: { page: ${pageVar}.default, layouts: [${layoutVars.map((v) => `${v}.default`).join(", ")}] }`
1323
1323
  );
1324
1324
  }
1325
1325
  return `/**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudwerk/vite-plugin",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "Vite plugin for Cloudwerk file-based routing with virtual entry generation",
5
5
  "repository": {
6
6
  "type": "git",