Components are exported to remote scopes to make them available for other consumers and collaborators. A component is decoupled from its workspace and ready to be exported ('staged') when its latest changes are snapped.
Check your workspace status to review which snaps are ready to be exported:
The output lists components, grouped by their status:
> apps/to-do versions: 0.0.1 ... ok
Run the following to export all staged components:
The output summarizes the number of exported components and their target remote scopes:
Exported components are hosted on their target remote scopes. Each remote scope stores the component versions and features a web UI similar to the workspace UI, in which all components are showcased.
To see all exported components open your browser and navigate to the Bit scope URL.
To stop maintaining a component after it has been exported, 'eject' it from your workspace. This will remove the component from the workspace and install its package, instead (for consumption only).
Alternatively, component can be ejected, directly, at any time:
The export process updates your workspace's .bitmap
file.
If you're using a traditional VCS like git to source-control your workspace, make sure to commit these changes.
To learn how to use your CI to export components see the 'integrating Bit with your existing CI' blog.
You may encounter merge conflicts when trying to export a component. That happens when the version you are trying to export already exists in the remote scope.
Solve this by running the following steps:
- Reset the components' latest unexported snaps (this will remove the latest snaps but will keep latest local changes):
Snap and export the component