> ## Documentation Index
> Fetch the complete documentation index at: https://aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# @aspect_rules_swc//swc:toolchain.bzl

> Bazel rules_swc Starlark toolchain rule swc_toolchain that exposes the SWC compiler binary to Bazel for JavaScript and TypeScript transpilation.

Documentation for [@aspect\_rules\_swc@v2.6.1](https://registry.bazel.build/modules/aspect_rules_swc/2.6.1) --  [View source](https://github.com/aspect-build/rules_swc/blob/v2.6.1/swc/toolchain.bzl)

This module implements the language-specific toolchain rule.

## Rule: `swc_toolchain`

Defines a swc compiler/runtime toolchain.

For usage see [https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains](https://docs.bazel.build/versions/main/toolchains.html#defining-toolchains).

### Attributes

**name** `name` *required*

A unique name for this target.

**target\_tool** `label` (default: None)

A hermetically downloaded 'swcx' cli for the target platform.

**target\_tool\_path** `string` (default: "")

Path to an existing 'swcx' cli for the target platform.

## Provider: `SwcInfo`

Information about how to invoke the tool executable.

### Fields

**swc\_binary**

Path to the rust-native 'swcx' cli for the target platform.

**tool\_files**

Files required in runfiles to make the tool executable available.

May be empty if the target\_tool\_path points to a locally installed tool binary.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.