Bit - Component Collaboration

Bit - Component Collaboration

  • Docs
  • Tutorials
  • Workflows
  • Support
  • Github

›Components

Introduction

  • Quick Start
  • How bit Works?
  • FAQ

Basics

  • Installation
  • Bit Workspace
  • Best Practices
  • Dependencies
  • Overrides

Components

  • Tracking
  • Building
  • Testing
  • Versioning
  • Documenting
  • Exporting
  • Removing & Deprecating
  • Installing
  • Importing
  • Viewing

Guidelines

  • React
  • Angular
  • Vue
  • Javascript
  • Typescript

Advanced

  • CI & Deployment
  • Bit Server
  • Usage Analytics

bit.dev

  • Overview
  • Account
  • Authentication
  • Security and Data Policy

Extending Bit

  • Extending Bit
  • Using Extensions
  • Developing Extensions
  • Build a compiler
  • Build a tester

Reference

  • Bit Client Configuration
  • Workspace Configuration
  • CLI Commands
Edit

Installing

Bit supports CommonJS API for consuming components as packages.

To install components with npm or yarn we first need to configure @bit as a scoped registry. Bit does it by default as part of the bit login process.

To configure the registry manully, use the npm config command.

npm config set '@bit:registry' https://node.bit.dev

To install private components use npm login. Use your Bit credentials to login.

npm login --registry=https://node.bit.dev [email protected]

Package names

Package naming convention includes the Bit owner, Collection name and the component ID (including namespaces).
For example:

yarn add <owner>.<collection>.<component-ID>

After installing the component as a package, import/require it in the following format:

import component from '@bit.<owner>.<collection>.<component-ID>';

Installing Components

To install dependencies for all the imported components use:

bit install

Add the --verbose flag to get detailed output.

You can also install dependencies for a specific component:

bit install foo/bar

If you need to pass extra arguments to npm or yarn, use double dash --, and after it add the additional arguments:

bit import -- --production --no-optional
← Removing & DeprecatingImporting →
  • Package names
  • Installing Components
Bit - Component Collaboration
bit.dev
ExploreTerms and PrivacySLA
Community
SlackGitterTwitter
More
BlogStar
Copyright © 2019 bit.dev