Simple CodeSandBox-like Web App, Install Dependencies and Run Code All In Your Browser.
- the root div id is
root
- automatic install dependencies by resolving import statements
For some reason, the code doesn't work in development, it only works in production.
npm i --force
npm run serve
- virtual file system
- resolve local relative path
- create fullstack to store user codes
- resizer
https://codesandbox.io/s/h4xfy
There is not much demo I can found on web, most are Codepen like example that cannot do import and transpilation
The above Codesandbox is one that has almost complete minimum viable solution.
Improvements:
- update esbuild and editor API to modern version (2022)
- add console (the original one is not working)
- simplify logics, especially on the iframe
- remake UI and add light theme