Using env.jsonc, you control the dependencies of components in a central configuration file.
This is commonly used for setting peer dependencies such as your framework, styled-components
, or dev dependencies like typescript
or jest
.
For example, configuring @bitdev/harmony.harmony as a peer dependency requires setting up the version you want your component to use for it's build and other operations. You can also set an optional compatibility version range.
{
"policy": {
"peers": [
{
"name": "@bitdev/harmony.harmony", // name of the dependency
"version": "1.0.3", // version to use for development purposes
"supportedRange": "^1.0.3" // supported range to expects consumers to have
}
]
}
}
When to use peers
?
To better understand when to set dependencies as peerDependencies
, see here