Sandbox manager for whateverpack tile previews
npm install @thewhateverapp/sandboxSandbox client for whateverpack tile previews. A fork of @codesandbox/sandpack-client with customizations for the Whatever platform.
``bash`
npm install @thewhateverapp/sandboxor
yarn add @thewhateverapp/sandbox
`js
import { loadSandpackClient } from "@thewhateverapp/sandbox";
const client = await loadSandpackClient("#preview", {
files: {
"/index.js": {
code: console.log("Hello from sandbox"),`
},
},
entry: "/index.js",
}, {
bundlerURL: "https://static.thewhatever.app/whateverpack/bundler/",
});
- Explicit bundlerURL - Client requires bundler URL, no implicit CDN fallback
- Module Registry - moduleRegistry option for CJS helper resolutionedgeRouteShims
- Edge Route Shims - option with defaults for next/server, next/headersvendorModules
- Vendor Modules - option to inject pre-bundled packagessandboxModules
- Sandbox Modules - option for injecting modules that run before user codecdnRoot` option to use custom npm packager
- Custom CDN -
Apache-2.0