-
Notifications
You must be signed in to change notification settings - Fork 258
Description
I'm working on a use case where users can switch between different project templates—for example, starting with React (which installs its dependencies), and later switching to something like Next.js.
The issue I'm facing is that once dependencies for one framework are installed, switching to another doesn't clean up the previous environment, causing the WebContainer to grow in size and behave inconsistently.
I tried using webContainer.teardown(), but it doesn't seem to fully reinitialize the container. I'm looking for a clean way to reset or reinitialize the entire WebContainer instance so that switching between stacks (like React → Next.js → Vue, etc.) is fully isolated each time.
Question:
How are you handling this kind of scenario in your setup? Is there a reliable way to reset WebContainer to a clean state?
Thanks in advance!