An app is a component that can be served, built and deployed. Naturally, apps have dependencies (components and packages) but no dependents.
For example, the apps/bit-dev
component is an app. It uses ui/community-docs
, a standard Bit component, as a dependency:
Run the following to list all available apps in your workspace:
The output lists the IDs of the available app components and their corresponding app names:
│ id │ name │
├────────────────────────────────┼──────────┤
│ teambit.community/apps/bit-dev │ bit-dev │
└────────────────────────────────┴──────────┘
Run the following to run an app locally, independent of Bit's dev server:
The output is similar the following (open the listed path and port in your browser, to explore your app):
Run the following to create an app using your env's component generator:
The output displays the ID of the generated app (component):
my-org.my-scope/apps/todo
location: my-scope/apps/my-react-app
env: teambit.harmony/aspect (set by template)
The generated app component includes an app plugin file, my-app.react-app.ts
, with a file extension that is detected
by its corresponding application-type - in this case, the React app-type. Use a different plugin file to switch from Bit's official React app-type, to a different app-type.
This will affect how your app is being served, built and deployed.
Install the app's dependencies:
Run the following using the app's component ID to make this app loadable by your workspace:
To define an existing component as an app, add to its directory an app plugin file.
Note that the specific file extension of a plugin file determines its application type.
For example, the following .react-18-app.cjs
file extension is loaded by Bit's official React application type.
/* @filename: my-app.react-18-app.cjs */ /** @type {import("@teambit/react.apps.react-app-types").ReactAppOptions} */ module.exports.default = { name: 'hello-world-app', entry: [require.resolve('./hello-world.app-root')], favicon: require.resolve('./favicon.svg'), };
To make this app loadable by your workspace, run the following:
Search bit.cloud for React apps. Fork app components to get started quicker, with apps that already have much of the setup you need.
For example, run the following to fork the wiki app to your workspace:
Run the following to make the forked app loadable by your workspace: