Standalone starters (or plugin-based starters) can be used without any special setup.
To set up an env-dependent starter, follow the steps below:
- Install the starter in the workspace that maintains the env (which will be used to register it):
$bit install @teambit/react.generator.react-starters
- Set the generator in the relevant env:
/* @filename: my-env.bit-env.ts */ import { StarterList } from '@teambit/generator'; /* import the starter */ import { ReactWorkspaceStarter } from '@teambit/react.generator.react-starters'; export class MyEnv{ starters() { return StarterList.from([ReactWorkspaceStarter.from({})]); } }
- Export the env and the starter.
name
: the generator's namedescription
: the generators descriptionhidden
: display the generator only when runningbit templates --show-all
env
: set the generated components with this env (component id)
starters() { return StarterList.from([ ReactEnvWorkspaceStarter.from({ name: 'my-custom-name', description: 'My custom starter description', }), ]); }