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:169
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:183
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:192
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:201
npmRegistries
• Optional
npmRegistries: Omit
<NpmRegistry
, "proxyEnabled"
>[]
The custom private npm registry setting makes it possible to retrieve npm packages from your own npm registry.
Examples:
{
enabledScopes: ["@codesandbox"],
registryUrl: "//my-registry.domain.com",
limitToScopes: true, // if false all packages will be fetched from custom registry
registryAuthToken: "SECRET" // optional value, if public
}
Defined in
sandpack-react/src/types.ts:217