Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Last active September 27, 2023 11:54
Show Gist options
  • Save wtnabe/4799e28d68aeff7c6feb9f9b52ca61b3 to your computer and use it in GitHub Desktop.
Save wtnabe/4799e28d68aeff7c6feb9f9b52ca61b3 to your computer and use it in GitHub Desktop.
StorybookでCustomElementsの情報をいい具合に出す

以下は Storybook 7.4+ / CSF 3+ を想定。

  1. 動作についてはなんとかしているものとする1
  2. story の export default で tags: ['autodocs'] か ./storybook/main.js で docs: { autodocs: true }
  3. JSDoc をいい具合に書く
  4. Custom Elements Manifest Analyzer で manifest を生成する
  5. Manifest を Storybook の config で読み込む

Footnotes

  1. 一部 Vite + Storybook で default ではうまく依存解決できないとかあるけど

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment