feat(workbench): add file tree and hook up editor

This commit is contained in:
Dominic Elm
2024-07-18 23:07:04 +02:00
parent 012b5bae80
commit a7d8693d8c
17 changed files with 806 additions and 148 deletions

View File

@@ -1,4 +1,5 @@
import { WebContainer } from '@webcontainer/api';
import { WORK_DIR_NAME } from '../../utils/constants';
interface WebContainerContext {
loaded: boolean;
@@ -20,7 +21,7 @@ if (!import.meta.env.SSR) {
webcontainer =
import.meta.hot?.data.webcontainer ??
Promise.resolve()
.then(() => WebContainer.boot({ workdirName: 'project' }))
.then(() => WebContainer.boot({ workdirName: WORK_DIR_NAME }))
.then((webcontainer) => {
webcontainerContext.loaded = true;
return webcontainer;