@thewhateverapp/sandbox
v2.0.0
Published
Sandbox manager for whateverpack tile previews
Maintainers
Readme
@thewhateverapp/sandbox
Sandbox client for whateverpack tile previews. A fork of @codesandbox/sandpack-client with customizations for the Whatever platform.
Installation
npm install @thewhateverapp/sandbox
# or
yarn add @thewhateverapp/sandboxUsage
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/",
});Key Customizations
- Explicit bundlerURL - Client requires bundler URL, no implicit CDN fallback
- Module Registry -
moduleRegistryoption for CJS helper resolution - Edge Route Shims -
edgeRouteShimsoption with defaults fornext/server,next/headers - Vendor Modules -
vendorModulesoption to inject pre-bundled packages - Sandbox Modules -
sandboxModulesoption for injecting modules that run before user code - Custom CDN -
cdnRootoption to use custom npm packager
License
Apache-2.0
