Skip to main content

@roots/bud-swc

danger

This extension is experimental.

SWC can be added by installing the @roots/bud-swc extension.

Installation

yarn add @roots/bud-swc --dev

Configuration

You have two options for configuring SWC:

bud.swc

You may use bud.swc api in your bud configuration file:

bud.swc.setOptions({
jsc: {
// ...,
},
})

.swcrc

You may also use a standard .swcrc config file in the root of your project.

Typechecking

@roots/bud-swc does not currently support typechecking during compilation.

Our recommendation is to run typechecking as a separate process. You can use the bud typecheck command or even use tsc directly: tsc --noEmit.

You could also add the fork-ts-webpack-plugin in your bud configuration. This approach conflicts with bud.config files authored in typescript.

Subscribe to swc-project/swc#571 for more information on where swc-project is at with its typecheck implementation.