Use component generators

Dev environments usually include component generator templates. To use new templates, choose the desired env below:

Configure the chosen development environment Component ID in your workspace.jsonc:

// workspace.jsonc
{
  "teambit.generator/generator": {
    "envs": ["teambit.node/node"]
  }
}
CopiedCopy

Make sure the chosen env is installed by running the following command:

$bit
Copiedcopy

Generate a component

Run the following command to list all the component templates available in your workspace:

$bit
Copiedcopy

Run the following command to generate a new component using a template:

$bit
Copiedcopy

Run component generators not available in your workspace

Run the following command to list all the component templates provided by an env:

$bit
Copiedcopy

Run the following to create a new component using a template from an env:

$bit
Copiedcopy

Override the generator's default env

A generator is not only responsible for generating the component's files, but also for creating the component's configuration, mainly, the component's env.

To override the generator's default env, use the --override flag:

$bit
Copiedcopy