Skip to content

Commit 94ab9a4

Browse files
author
Rich Harris
committed
Merge branch 'main' of github.com:sveltejs/learn.svelte.dev
2 parents 4679daf + 192b36b commit 94ab9a4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

scripts/create-common-bundle/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { execSync } from 'child_process';
77

88
const cwd = 'content/tutorial/common';
99

10-
if (!fs.existsSync(`${cwd}/node_modules`)) {
11-
execSync('npm ci', { cwd });
12-
}
10+
execSync('npm ci', { cwd });
1311

1412
const zip = new AdmZip();
1513

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ export async function create(base, error, progress, logs) {
138138

139139
// Don't delete the node_modules folder when switching from one exercise to another
140140
// where, as this crashes the dev server.
141-
['/node_modules', '/node_modules/.bin'].forEach((name) => current_stubs.delete(name));
141+
const to_delete = Array.from(current_stubs.keys()).filter(
142+
(s) => !s.startsWith('/node_modules')
143+
);
142144

143-
const to_delete = Array.from(current_stubs.keys());
144145
current_stubs = stubs_to_map(stubs);
145146

146147
// For some reason, server-ready is fired again when the vite dev server is restarted.

src/routes/tutorial/[slug]/Editor.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@
5151
5252
$: reset($files);
5353
54+
$: select_state($selected_name);
55+
5456
$: if (editor_view) {
55-
select_state($selected_name);
5657
5758
if ($selected_name) {
5859
const current_warnings = $warnings[$selected_name];

0 commit comments

Comments
 (0)