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 React bit-dev
component is an app.
It uses ui/community-docs
, a standard Bit React component, as a dependency:
Run the following command 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:
After building the app bundle, the dev server will list the path and port of your app:
Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 1.72 MB |
polyfills.js | polyfills | 323.16 kB |
styles.css, styles.js | styles | 215.76 kB |
main.js | main | 48.75 kB |
runtime.js | runtime | 6.52 kB |
| Initial Total | 2.30 MB
Build at: 2023-02-24T10:11:28.649Z - Hash: 8186441b3939ed80 - Time: 10028ms
Run the following command to create an app using the ng-app
template of your env:
The output displays the ID of the generated app (component):
my-org.my-scope/apps/my-angular-app
location: my-scope/apps/my-angular-app
env: my-org.my-scope/envs/my-angular-env (set by template)
package: @my-org/my-scope.apps.my-angular-app
The generated app component includes an app plugin file, my-app.ng-app.ts
,
with a file pattern that is detected by its corresponding application-type,
in this case the Angular app-type.
Use a different plugin file pattern to switch from Bit's official Angular app-type, to a different app-type.
This will affect how your app is being served, built and deployed.
Install the app's dependencies with the following command: