Skip to main content

Interface: SandpackSetup

Properties

dependencies

Optional dependencies: Record<string, string>

Any template will include the needed dependencies, but you can specify any additional dependencies. The key should be the name of the package, while the value is the version, in exactly the same format as it would be inside package.json.

Examples:

{
 "react": "latest",
 "@material-ui/core": "4.12.3",
}

Defined in

sandpack-react/src/types.ts:164


devDependencies

Optional devDependencies: Record<string, string>

Sandpack doesn't install devDependencies, because most tools in there were build tools, which is not necessary to properly run a sandbox, but maybe required for running locally or export to CodeSandbox.

Examples:

{
 "@types/react": "latest",
}

Defined in

sandpack-react/src/types.ts:178


entry

Optional entry: string

The entry file is the starting point of the bundle process.

If you change the path of the entry file, make sure you control all the files that go into the bundle process, as prexisting settings in the template might not work anymore.

Defined in

sandpack-react/src/types.ts:187


environment

Optional environment: SandboxEnvironment

Each sandbox has its own bundler attached to them which are configured to support a specific framework and emulate their official CLI tools. They are not one-to-one implementations and thus do not support advanced configuration like custom webpack configurations or ejecting. However, they are designed to mirror the default behavior of the framework

Defined in

sandpack-react/src/types.ts:196