Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-cli-plugin-storybook

storybookjs34.8kMIT2.1.0

Vue CLI plugin for Storybook

vue, vue-cli, storybook

readme

vue-cli-plugin-storybook

Vue CLI plugin for Storybook

Installation

$ vue add storybook

Usage

It will create a config folder for storybook, a sample component and a sample story. The webpack config used for storybook is resolved from vue-cli-service, which means you don't need to have any special webpack section in storybook config folder.

However, storybook will filter all the plugins for webpack according to internal list of allowed plugins. If you are extending your config with your custom plugins, you can extend list of allowed plugins by passing their names through pluginOptions in your vue.config.js like this:

{
  pluginOptions: {
    storybook: {
      allowedPlugins: [
        'define'
      ]
    }
  }
}

The name of the plugin is the string used in webpack-chains config.plugin(...) call.

Note that only plugins defined with webpack-chain config can be filtered using the allowedPlugins option. Plugings defined through configureWebpack will always be included in the final webpack config.

Contributors

Here is a list of Contributors

We particularly thank Almas Akchabayev <almas.akchabayev@gmail.com> for the initial code and willing to transfer the project to us.

TODO

I accept pull requests and guarantee a reply back within a day

License

MIT/X11

Bug Reports

Report here. Guaranteed reply within a day.

Contact

Pavan Kumar Sunkara (pavan.sss1991@gmail.com)

Follow me on github, twitter

changelog

Changelog

2.1.0

Enhancements

  • Supports vue v3

2.0.0

Enhancements

  • (Breaking) Supports Storybook 6. Removed support for all older versions

1.3.0

Enhancements

  • Remove addon-notes from being included in the initial generation

1.2.2

Enhancements

  • Prevent global CSS imports from being removed by storybook-build

Bug Fixes

  • Fixes some issues with eslint without eslint-plugin-import

1.2.1

Enhancements

  • Added docs option for commands
  • Use RVueComponent JSX in MDX

1.2.0

Enhancements

  • Added option to use Storybook CSF (component story format)
  • Added option and support for Storybook DocsPage and MDX stories
  • Sets VUE_CLI_STORYBOOK env variable to either serve or build when ran
  • Typescript support
  • Added storybook-static to git ignore list when the plugin is invoked

Bug Fixes

  • Fixes broken storybook:build for storybook@>=5.3

1.1.0

Enhancements

  • Support storybook@>=5.3
  • Generating single config file for Storybook

1.0.0

Enhancements

  • Now asks the user what storybook version they want to install during init

Breaking

  • @storybook/vue is now a required peer dependency instead of direct

0.6.1

Bug Fixes

  • Fix bug with addon versions not being updated in the previous version

0.6.0

Enhancements

  • Allow support for storybook 5

0.5.2

Enhancements

  • Allow the storybook plugin to take storybook options

0.5.1

Bug Fixes

  • Allow support for vue-cli's configureWebpack

0.5.0

Breaking

  • Changed the commands in to storybook:serve and storybook:build

Enhancements

  • Upgraded storybook dependencies to ^4.1.0
  • Allow customization of plugins that can be whitelisted

Bug Fixes

  • Add babel-loader needed by storybook to vue project if it doesn't use babel at all

[0.4.8] (2018-09-12)

Bug Fixes

  • Pin storybook to alpha20

0.4.7 (2018-09-05)

Bug Fixes

  • Whitelist the plugins coming from vue config instead of blacklisting

0.4.6 (2018-09-01)

Bug Fixes

  • Removed preload and prefetch plugins from vue config before sending to storybook config

0.4.5 (2018-09-01)

Enhancements

  • Upgraded storybook dependencies to alpha20

0.4.4 (2018-08-16)

Enhancements

  • Lint fix the generated files
  • Used vue app's webpack plugins for building storybook

0.4.3 (2018-08-15)

Bug Fixes

  • Resolve webpack config of application when running the storybook command rather than loading the plugin
  • No JSX story when @vue/cli-plugin-babel is installed

0.4.2 (2018-08-06)

Enhancements

  • Upgrade storybook dependencies to alpha16

0.4.1 (2018-08-05)

Enhancements

  • Pin storybook dependencies (until v4) and downgrade @storybook/vue to alpha14

0.4.0 (2018-08-05)

Breaking

  • Changed vue-cli-service storybook to vue-cli-service serve:storybook

Bug Fixes

  • Fixed the eslint hook issue after the plugin is added