Import

Imports a component to your project from a remote Scope.

Synopsis

bit import|i [-t|--tester] [-v|--verbose] [-c|--compiler] [-e|--environment] [--extension] [-p|--path <directory>] [-d|--display-dependencies] [-O|--override] [--dist] [--conf] [--ignore-package-json] [ids...]

Examples

Import a single component from a remote Scope

When importing a component, it will be imported to the default location listed in the bit.json file. Component is imported without its environments by default.

bit import username.foo/bar

In order to import a component to a specific location, use the --path flag:

bit import username.foo/bar --path src/foo

In order to import a component with its environments, use the --environment flag:

bit import username.foo/bar --environment

In order to import a component’s specific version, use the @ sign:

bit import username.foo/bar@1.0.4

Import project’s component objects from their remote Scope

The bit.json file contains a list of the project’s sourced components. In order to import all of their updated objects (similar to running git fetch) at once.

bit import

Import project’s environments

The bit.json file contains the project’s environments (compiler and tester). In order to import those, don’t specify a specific component, and use the --environment flag:

bit import --environment

Import a new environment

In order to import and set a new environment for your project’s components, use the --tester and --compiler flags:

$ bit import bit.envs/compilers/babel --compiler
$ bit import bit.envs/testers/mocha --tester

Import an extension

In order to import a new extension for your project, use the --extension flag:

bit import bit.extensions/commands/pack --extension

Pass an extra arguments to npm

In order to pass extra arguments to an npm client, place the arguments after --.

bit import -- --production --no-optional

Options

-t, —tester

Import a tester environment component

bit import bit.envs/testers/mocha --tester

-v, —verbose

Show a more verbose output when possible.

bit import username.foo/bar --verbose

-c, —compiler

Import a compiler environment component.

bit import bit.envs/compilers/babel --compiler

-e, —environment

Install development environment dependencies (compiler and tester), or import a component AND its environments.

bit import -e
bit import username.foo/bar --environment

-p, —path

Import components into a specific directory.

bit import username.foo/bar --path src/foo

-d, —display-dependencies

Display the imported dependencies

bit import username.foo/bar --display-dependencies

-O, —override

Ignore local changes (import a component’s new version even though it was changed locally).

bit import username.foo/bar --override

—dist

Write dist files (when exist) to the configured directory

bit import username.foo/bar --dist

—conf

Write the configuration file (bit.json).

bit import username.foo/bar --conf

—ignore-package-json

Do not generate package.json for the imported component(s).

bit import username.foo/bar --ignore-package-json

—extension

Import an extension components.

bit import bit.extensions/commands/pack --extension
  • cli export
  • cli install