A Storybook Addon to write Storybook's stories using Vue SFC syntax and automatically convert them to Storybook CSF

View on Github

storybook-vue-csf-addon

This project started as a fork of storybook-vue-addon

🚧 Work in progress 🚧

Install

npm i -D storybook-vue-csf-addon
// vite.config.ts
import Starter from 'storybook-vue-csf-addon/vite'

export default defineConfig({
  plugins: [
    Starter({ /* options */ }),
  ],
})

Example: playground/

// rollup.config.js
import Starter from 'storybook-vue-csf-addon/rollup'

export default {
  plugins: [
    Starter({ /* options */ }),
  ],
}

// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('storybook-vue-csf-addon/webpack')({ /* options */ })
  ]
}

// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    ['storybook-vue-csf-addon/nuxt', { /* options */ }],
  ],
})

This module works for both Nuxt 2 and Nuxt Vite

// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('storybook-vue-csf-addon/webpack')({ /* options */ }),
    ],
  },
}

// esbuild.config.js
import { build } from 'esbuild'
import Starter from 'storybook-vue-csf-addon/esbuild'

build({
  plugins: [Starter()],
})