I've seen a lot of people struggle to get storybook and vue CLI working side-by-side, particularly with the new addon-docs
. So here's a working example.
Steps I used to create:
- Init a typescript project with Vue-Cli (v4, which was just released)
- Add Vue Cli Storybook Plugin
- Disable Vue Jsx in the babel config (Vue Jsx is temporarily incompatible with addon-docs):
// babel.config.js
module.exports = {
presets: [["@vue/cli-plugin-babel/preset", {
jsx: false
}]]
};
yarn
yarn storybook:serve
yarn storybook:build
yarn lint --fix