This repo is a minimal setup for a vue cli3 project to use Storybook.
Updated to work with latest @vue/cli 3.0.0-rc.1
$ git clone https://github.com/davestaab/vue-cli3-storybook
$ yarn
$ yarn storybook
I assume the following versions
$ node -v
v8.11.2
$ yarn -v
1.7.0
yarn global add @vue/cli
vue --version
3.0.0-rc.1
To setup from scratch take the following steps
vue create <folder-name>- choose default preset (babel, eslint)
cd <folder-name>yarn add --dev [email protected]yarn add --dev @storybook/vueyarn add --dev vue-template-compiler- add storybook cmd to
package.json"scripts": { "storybook": "start-storybook -p 9001 -c .storybook" ... } - add config for babel in
.storybook/.babelrc - add config for webpack in
.storybook/webpack.config.js - add storybook config file in
.storybook/config.js - add a story for component in
src/components/HelloWorld.story.js - Done! Run storybook
yarn storybook
yarn serve- run the vue applicationyarn storybook- run storybook
Currently working with the following dependencies.
- @vue/cli 3.0.0-rc.1
- @storybook/vue 3.4.7
- babel-core 7.0.0-bridge.0
- vue-template-compiler 2.5.16