Using compilers

Use the unified compiler CLI, UI and API, to run the different compilers your workspace components use.

Compile all components in the workspace:

$bit
Copiedcopy
See command synopsis

The compiled code can be found in each component's corresponding package, in the workspace node_modules directory.

Run the the compiler in 'watch mode' (recompile on component changes):

$bit
Copiedcopy
See command synopsis

When running Bit's dev server (bit start), the compiler runs in 'watch mode', by default.

Use the --check-types to get type errors during development (by default, type-checking happens only during build):

$bit
Copiedcopy

Compile during build

Run the following to compile during build:

$bit
Copiedcopy
See command synopsis

By default, the compiler outputs the compiled files to the dist directory, in each component's capsule. In addition to the compiled JS files, the dist directory may include the generated declaration files, and copied files that cannot be compiled by the compiler.

For example:

.
├── welcome.d.ts
├── welcome.js
├── welcome.js.map
├── welcome.module.scss
├── index.d.ts
├── index.js
└── index.js.map
CopiedCopy