component.json

The component.jsonc file enables you to set component configurations directly on a component. The component.jsonc configuration is merged with the configurations set by Variants.

To eject it to the component's directory, run:

bit eject-conf <component-full-name>
CopiedCopy

For example:

bit eject-conf ui/text
CopiedCopy

The ejected file will contain the following:

{
  "componentId": {
    "name": "ui/text",
    "version": "0.0.1",
    "scope": "company.scope"
  },
  "propagate": false,
  "extensions": {}
}
CopiedCopy

propagate

Set the propagate property to true if you want the component to be affected by the workspace configurations.

extensions

Use the extensions property to configure Aspects. Configuration is done similarly to the workspace configuration file (workspace.jsonc).

For example, to set a dependency policy using the Dependency Resolver Aspect:

{
  "componentId": {
    "name": "ui/text",
    "version": "0.0.1",
    "scope": "company.scope"
  },
  "propagate": true,
  "extensions": {
    "teambit.dependencies/dependency-resolver": {
      "policy": {
        "dependencies": {
          "lodash": "^14.17.21"
        }
      }
    }
  }
}
CopiedCopy