File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/lib/client/adapters/webcontainer Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { ready } from '../common/index.js';
6
6
let vm ;
7
7
/** @type {Promise<import('$lib/types').Adapter> | undefined } */
8
8
let instance ;
9
+ /** @type {Map<string, string> } latest contents of some special files for comparison */
10
+ const file_contents = new Map ( ) ;
9
11
10
12
/**
11
13
* @param {import('$lib/types').Stub[] } stubs
@@ -192,10 +194,12 @@ async function _create(stubs) {
192
194
}
193
195
}
194
196
195
- await vm . loadFiles ( convert_stubs_to_tree ( stubs ) ) ;
197
+ stubs = stubs . filter (
198
+ ( stub ) => stub . type !== 'file' || file_contents . get ( stub . name ) !== stub . contents
199
+ ) ;
196
200
201
+ await vm . loadFiles ( convert_stubs_to_tree ( stubs ) ) ;
197
202
await promise ;
198
-
199
203
await new Promise ( ( f ) => setTimeout ( f , 200 ) ) ; // wait for chokidar
200
204
201
205
resolve ( ) ;
You can’t perform that action at this time.
0 commit comments