Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
JSONTools / Schema registry / cosmos.config.json
Schema registry

cosmos.config.json

React Cosmos configuration file

cosmos.config.json

Check your file against this schema

Opens the validator with this schema already loaded. Paste your cosmos.config.json and it validates in your browser — nothing is uploaded.

Validate a cosmos.config.json → View raw schema

Fields

Generated directly from the schema, following local $refs, to two levels of nesting.

Field Type Description
$schemastring
rootDirstringThe root directory that all others paths in this config are relative to. Usually the root of your repo. If omitted, rootDir is equal to the directory containing your Cosmos config. When you don't use a Cosmos config, rootDir defaults to
exportPathstringWhere to generate static exports on disk. [default: "cosmos-export"]
detectLocalPluginsbooleanAutomatically detect and load local plugins
disablePluginsbooleanDisable plugins
staticPathstringDir path to serve static assets from.
pluginsarray<string>Module IDs of Cosmos plugins (eg. "react-cosmos-plugin-open-fixture" or "../path/to/my-plugin").
publicUrlstringBase URL for static assets. [default: "/"]
fixturesDirstringName for directories that contain fixtures (eg. __fixtures__/example.jsx). [default: "__fixtures__"]
fixtureFileSuffixstringSuffix for fixture files (eg. example.fixture.jsx). [default: "fixture"]
ignorearray<string>Patterns for ignoring fixture and decorator files (eg. ["**/dist/**"]]).
watchDirsarray<string>Directories where the Cosmos server watches for fixture files changes while running. [default: ["."]]
lazybooleanDynamically import fixture and decorator modules as they are loaded. When false all fixture and decorator modules are imported statically and bundled together. [default: false]
exposeImportsanyOfExpose user imports and config required for the Cosmos renderer. Used with React Native and in custom integrations. When a path is specified it requires a file extension (eg. "src/cosmos.imports.ts"). [default: false]
hostnameanyOfDev server hostname. Set to null to accept connections with any hostname. [default: null]
portnumberDev server port. [default: 5000]
portRetriesnumberMax number of port retries. [default: 10]
httpsbooleanServer will be served over HTTPS.
httpsOptionsobjectAdditional options for HTTPS server.
httpsOptions.certPathstringPath of a certificate file
httpsOptions.keyPathstringPath of a certificate's key file
httpProxyobjectProxy some URLs to a different HTTP server (eg. an API backend dev server). Similar to devServer.proxy in webpack config.
globalImportsarray<string>Modules to be imported before loading components. Stuff like reset.css, polyfills, etc.
rendererUrlanyOfRequired when renderer doesn't run on the same port (or host) as the Playground. Useful for integrations with build tools. [default: null]
domobjectDOM-related options
dom.containerQuerySelectoranyOfDocument selector for existing element to use as component parent (eg. #root). A blank container element is created from scratch if no selector is provided. [default: null]
viteobjectVite-related options
vite.configPathanyOfPath to Vite config. Set to false to disable reading it from the default path. [default: "vite.config.js"]
vite.indexPathanyOfPath to index module (eg. "src/my-index.tsx"). [default: matches common index/main module paths]
vite.portnumberVite renderer port. [default: 5050]
webpackobjectWebpack-related options
webpack.configPathanyOfPath to an existing webpack config, which Cosmos will reuse to build your code. Set to null to disable this behavior. [default: "webpack.config.js"]
webpack.overridePathanyOfPath to a user module that customizes the webpack config used by Cosmos. Set to null to disable this behavior. [default: "webpack.override.js"]
webpack.includeHashInOutputFilenamebooleanChanges output filename from "[name].js" to "[name].[contenthash].js". [default: false]
webpack.hotReloadbooleanEnable webpack's Hot Module Replacement. [default: true]
webpack.reloadOnFailbooleanWhen using webpack's Hot Module Replacement, enable automatic location reload after webpack fails to update modules. [default: false]
uiobjectUI plugin options
ui.responsivePreviewobject
ui.responsivePreview.devicesarray<object>List of device viewports

What we found in this schema

Specification sections for the keywords in this schema

Keyword Document Section
$idJSON Schema Core, draft 2020-12§8.2.1 — The "$id" Keyword
$schemaJSON Schema Core, draft 2020-12§8.1.1 — "$schema"
additionalPropertiesJSON Schema Core, draft 2020-12§10.3.2.3 — "additionalProperties"
anyOfJSON Schema Core, draft 2020-12§10.2.1.2 — "anyOf"
descriptionJSON Schema Validation, draft 2020-12§9.1 — "title" and "description"
itemsJSON Schema Core, draft 2020-12§10.3.1.2 — "items"
minLengthJSON Schema Validation, draft 2020-12§6.3.2 — "minLength"
minimumJSON Schema Validation, draft 2020-12§6.2.4 — "minimum"
patternPropertiesJSON Schema Core, draft 2020-12§10.3.2.2 — "patternProperties"
propertiesJSON Schema Core, draft 2020-12§10.3.2.1 — "properties"
requiredJSON Schema Validation, draft 2020-12§6.5.3 — "required"
typeJSON Schema Validation, draft 2020-12§6.1.1 — "type"
uniqueItemsJSON Schema Validation, draft 2020-12§6.4.3 — "uniqueItems"

Documents

Attribution

This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.

← All schemas