Skip to content

Commit

Permalink
Add documentation about swc plugins feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Karibash committed Mar 30, 2022
1 parent 541b86e commit 8b587da
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-rules-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"storybook-addon-swc": patch
---

Add documentation about swc plugins feature
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@ module.exports = {
| `swcLoaderOptions` | Options for swc loader. | [object](https://swc.rs/docs/configuration/compilation) | [see](https://github.com/Karibash/storybook-addon-swc/blob/master/src/index.ts#L19-L32) |
| `swcMinifyOptions` | Options for swc minify. | [object](https://swc.rs/docs/configuration/minification) | [see](https://github.com/Karibash/storybook-addon-swc/blob/master/src/index.ts#L33-L37) |

### SWC Plugins

The SWC plugins feature is still experimental, but can be used by changing the settings as follows.

```js
module.exports = {
addons: [
{
name: 'storybook-addon-swc',
options: {
swcLoaderOptions: {
jsc: {
experimental: {
plugins: [['plugin-name', {}]],
},
},
},
},
},
],
};
```

## 🎓 Alternative

### [storybook-addon-turbo-build](https://github.com/pocka/storybook-addon-turbo-build)
Expand Down

0 comments on commit 8b587da

Please sign in to comment.