Is it possible to create virtual fs in browser for react project?

Viewed 299

Here's the idea: I want to build some kind of CodeSandBox clone for my educational project. Decided to go with new Pika CDN & ES Modules, since I don't need to support old browsers + tech seems very interesting. So no bundling. User will type something in Monaco editor (React project), it will be stored in IndexedDB via "BrowserFS". Then, within browser I want to read all this data and recreate it virtually with the same structure, so everything works, for example: "import MyComponent from "./MyComponent.js"" will still work. Is it possible? I see there are browser FileSystem implementation made by Google, that would do this by allowing to create folders/files, but as I see it was abandoned...

For now, tried just importing stuff back from IndexedDB, but then I end up with file content, not imported component from that folder.

0 Answers
Related