Skip to content

fix: wrong mainFile name when switching development mode #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ export class ReplStore implements Store {
setFile(files, mainFile, welcomeCode)
}
for (const filename in newFiles) {
setFile(files, filename, newFiles[filename])
const normalized = setFile(files, filename, newFiles[filename])
if (mainFile === filename) {
mainFile = normalized
}
}
for (const file in files) {
await compileFile(this, files[file])
Expand Down Expand Up @@ -374,6 +377,7 @@ function setFile(
? `src/${filename}`
: filename
files[normalized] = new File(normalized, content)
return normalized
}

function fixURL(url: string) {
Expand Down