Skip to content

Commit d2a5d25

Browse files
Rich-HarrisRich Harris
andauthored
inject client in src/error.html (sveltejs#343)
* inject client in src/error.html * Update src/lib/client/adapters/webcontainer/index.js --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 5f4cc5d commit d2a5d25

File tree

1 file changed

+2
-5
lines changed
  • src/lib/client/adapters/webcontainer

1 file changed

+2
-5
lines changed

src/lib/client/adapters/webcontainer/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,8 @@ function convert_stubs_to_tree(stubs, depth = 1) {
274274
/** @param {import('$lib/types').FileStub} file */
275275
function to_file(file) {
276276
// special case
277-
if (file.name === '/src/app.html') {
278-
const contents = file.contents.replace(
279-
'</head>',
280-
'<script type="module" src="/src/__client.js"></script></head>'
281-
);
277+
if (file.name === '/src/app.html' || file.name === '/src/error.html') {
278+
const contents = file.contents + '<script type="module" src="/src/__client.js"></script>';
282279

283280
return {
284281
file: { contents }

0 commit comments

Comments
 (0)