Skip to content

Commit

Permalink
fix: #2 client.ts not loading in an iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakeskeyboarde committed Aug 10, 2024
1 parent 0e8a1ca commit 79d8522
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-live-preview",
"version": "0.2.1",
"version": "0.2.2",
"description": "Vite build with preview.",
"license": "ISC",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default ({ base }: Options): Connect.NextHandleFunction => {

if (injectIndex >= 0) {
content = text.slice(0, injectIndex);
content += `<script crossorigin="" src=${clientSrc}></script>\n`;
content += `<script src=${clientSrc}></script>\n`;
content += text.slice(injectIndex);
res.setHeader('Content-Length', Buffer.byteLength(content, 'utf8'));
debug?.(`injected client script into "${req.url}".`);
Expand Down

0 comments on commit 79d8522

Please sign in to comment.