There are some advanced use cases where you might need more control over a sandbox or template. That's why we support configuration files. Every template on CodeSandbox has a list of configuration files it supports. You can see the supported files under Configuration Files from the left-hand activity bar in the editor.
Some configuration files can be configured using a UI. This UI will generate a configuration file based on its state.
A sandbox can be configured too, you can do this with
support these options:
|Option||Description||Possible Values||Default Value|
|Whether we should throw an error if we detect an infinite loop|
|Whether we should refresh the sandbox page on every change, good for sandboxes with global state|
|Which sandbox template to use||see here||smart detection, w/ fallback to |
|Which view to show first in the preview||Client: |
|Whether we should disable in-browser logging and have all logs created by the sandbox go to the browser console|
|The container object contains the port, start script and Node.js major version, for example: |
|The main port which the browser window listens to||1024 - 65535||First opened port inside the container.|
|Explicitly specify the start script used in a container sandbox, overriding the default value||A String matching a script name defined under |
|The Node.js major version to use inside the container. The exact versions used are as follows:|