Configuration
Use a Format studio config file to control the core behavior of Studio.
Name your config file format.config.json and place it in the root of your repo or package, next to the package.json. You can also use the .jsonc extension.
The $schema field gives you autocomplete and validation in your editor.
{
"$schema": "https://format.dev/schema/format-config.json",
"version": "0.1.2",
"framework": "react",
"sharedAssetsDir": "./assets"
}Reference
versionRequiredThe Format release version this project is pinned to. Every installed Format
package is kept in lockstep with this version. Set it to the version you
want and run format update to apply it everywhere. Must be an exact
version, never a range.
Type
stringExample
"0.1.2"frameworkRequiredWhich framework to use for your Format documents.
Type
"react" | "vue" | "html"$schemaPath or URL to the JSON schema for this file, used by editors for
autocomplete and validation. Set it to: https://format.dev/schema/format-config.json.
Type
stringExample
"https://format.dev/schema/format-config.json"rootDirThe root directory where all Format code is located, relative to the config file. Change this if you want to root your Format documents and data under a different directory. For example, setting this to "format" would result in your documents being located in "format/documents".
Type
stringDefault value
"./"Example
"format"cwdOverride the base path resolution for Format. Useful if you want to have your config in a different directory to the root of your project. For example, if you put your format.config.json file in a config directory, you could set cwd to ../ to tell Format to look for your project in the parent directory.
Type
stringDefault value
process.cwd()Example
"../"dotEnvPathSpecify a path to a .env file. If path is relative, this is resolved relative to cwd.
Type
stringDefault value
resolve(cwd, .env)Example
"../../.env"pandaCssPanda CSS configuration options. The PandaCssPostCssPluginOptions type is exposed as PluginOptions from the @pandacss/dev/postcss package. Useful resource: https://github.com/chakra-ui/panda/blob/main/packages/postcss/src/index.ts
Type
{ enabled: boolean, postCssConfig: PandaCssPostCssPluginOptions }Default value
{
enabled: false,
postCssConfig: {
cwd: rootDir || "./",
configPath: resolve(rootDir || "./", "panda.config.ts")
}
}Was this page helpful?