We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db2602b commit dbb6b0cCopy full SHA for dbb6b0c
src/lib/client/adapters/webcontainer/index.js
@@ -235,6 +235,8 @@ async function _create(stubs) {
235
236
await vm.loadFiles(root);
237
238
+ stubs_to_map(stubs, current);
239
+
240
await new Promise((f) => setTimeout(f, 200)); // wait for chokidar
241
}
242
@@ -302,8 +304,7 @@ function to_file(stub) {
302
304
* @param {import('$lib/types').Stub[]} stubs
303
305
* @returns {Map<string, string>}
306
*/
-function stubs_to_map(stubs) {
- const map = new Map();
307
+function stubs_to_map(stubs, map = new Map()) {
308
for (const stub of stubs) {
309
if (stub.type === 'file') {
310
map.set(stub.name, stub.contents);
0 commit comments