Skip to content

Commit dbb6b0c

Browse files
committed
[fix] update stub contents on update
1 parent db2602b commit dbb6b0c

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ async function _create(stubs) {
235235

236236
await vm.loadFiles(root);
237237

238+
stubs_to_map(stubs, current);
239+
238240
await new Promise((f) => setTimeout(f, 200)); // wait for chokidar
239241
}
240242

@@ -302,8 +304,7 @@ function to_file(stub) {
302304
* @param {import('$lib/types').Stub[]} stubs
303305
* @returns {Map<string, string>}
304306
*/
305-
function stubs_to_map(stubs) {
306-
const map = new Map();
307+
function stubs_to_map(stubs, map = new Map()) {
307308
for (const stub of stubs) {
308309
if (stub.type === 'file') {
309310
map.set(stub.name, stub.contents);

0 commit comments

Comments
 (0)