@stencil/dev-server 5.0.0-beta.0 → 5.0.0-beta.10

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.mjs +4 -2
  2. package/package.json +3 -4
package/dist/index.mjs CHANGED
@@ -987,8 +987,10 @@ function appendDevServerClientScript(devServerConfig, req, content) {
987
987
  return appendDevServerClientIframe(content, `<iframe title="Stencil Dev Server Connector ${VERSION} &#9889;" src="${devServerClientUrl}" style="display:block;width:0;height:0;border:0;visibility:hidden" aria-hidden="true"></iframe>`);
988
988
  }
989
989
  function appendDevServerClientIframe(content, iframe) {
990
- if (content.includes("</body>")) return content.replace("</body>", `${iframe}</body>`);
991
- if (content.includes("</html>")) return content.replace("</html>", `${iframe}</html>`);
990
+ const bodyIndex = content.lastIndexOf("</body>");
991
+ if (bodyIndex !== -1) return content.slice(0, bodyIndex) + iframe + content.slice(bodyIndex);
992
+ const htmlIndex = content.lastIndexOf("</html>");
993
+ if (htmlIndex !== -1) return content.slice(0, htmlIndex) + iframe + content.slice(htmlIndex);
992
994
  return `${content}${iframe}`;
993
995
  }
994
996
  async function serveDevClient(devServerConfig, serverCtx, req, res) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/dev-server",
3
- "version": "5.0.0-beta.0",
3
+ "version": "5.0.0-beta.10",
4
4
  "description": "Development server for Stencil with DOM-based HMR",
5
5
  "keywords": [
6
6
  "dev server",
@@ -45,11 +45,10 @@
45
45
  "tsdown": "^0.22.14",
46
46
  "typescript": ">5.0.0 <7.0.0",
47
47
  "vitest": "^4.1.10",
48
- "vitest-environment-stencil": "^1.14.0",
49
- "@stencil/core": "5.0.0-beta.0"
48
+ "vitest-environment-stencil": "^1.14.0"
50
49
  },
51
50
  "peerDependencies": {
52
- "@stencil/core": "^5.0.0 || 5.0.0-beta.0"
51
+ "@stencil/core": "^5.0.0 || 5.0.0-beta.10"
53
52
  },
54
53
  "volta": {
55
54
  "extends": "../../package.json"