# Understanding Plugins — Babel & SWC

Source: https://www.geekswithgeeks.com/en/babel-swc/bs-babel-plugins

> Plugins add targeted transformations beyond what presets offer.

## Presets are just plugin collections

A preset like `@babel/preset-env` is a curated list of plugins. You can use plugins individually for fine-grained control.

## Using individual plugins

Add specific plugins in `.babelrc` to transform particular syntax. E.g., `@babel/plugin-transform-optional-chaining` for `?.` operator.

```json
{
  "plugins": [
    "@babel/plugin-transform-optional-chaining",
    "@babel/plugin-transform-nullish-coalescing-operator"
  ]
}
```

## Plugins run before presets

Babel processes plugins first, then presets. Put experimental features in plugins; stable ones in presets.
