0.1.2 • Published 4 years ago

@dcrall/vue-storybook v0.1.2

Weekly downloads
2
License
-
Repository
-
Last release
4 years ago

vue-storybook

Introduction

This repo contains a proof-of-concept Vue CLI application. It demonstrates the use of CLI plugins to configure the project to use both Storybook and Tailwind. Additionally, the project's build script builds the project as a library intended to be consumed by other Vue applications.

It seems clear to me that using the CLI plugins are the best way to implement these types of configurations. Trying to manually override the Webpack configuration is quite complicated to track down all the needed options. I was unsuccessful configuring Storybook with Tailwind.

This configuration is nice in that Storybook shares the main Vue app's Webpack configuration, so there is no need to keep them in sync.

Finally, this configuration implements PurgeCSS and the generated CSS file contains only the Tailwind rules that are used.

Resources

Basic Configuration

$ vue create new-app
$ cd new-app

# Make sure to accept the option for the docs addon
# This automatically configures for MDX stories
$ vue add storybook

$ vue add tailwind

# See the final resource link to read about configuring as a component library 

Project setup

yarn install

Compiles and hot-reloads for development

yarn serve

Build and publish component library

npm run build
npm publish --access public

Lints and fixes files

yarn lint

Customize configuration

See Configuration Reference.