0.0.21 • Published 2 years ago
vite-plugin-vitebook v0.0.21
Vitebook
Storybook alternative, this is alpha version
Supported all framework which support vite. Work only dev command.
How use
Example config of vue 3
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vitebook from "vite-plugin-vitebook"
import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vitebook(
{
htmlTemplatePath: {
fullPath: path.resolve(__dirname, './index.html'), // this is html template
replace: '/src/main.ts' // this will replaced from scriptTemplatePath.scriptTemplatePath
},
scriptTemplatePath: {
fullPath: path.resolve(__dirname, './src/main.ts'), // this is script template
replace: './App.vue' // this will replaced selected book
}
}
)],
})
Then run vite with host config, for this change package.json
"scripts": {
"dev": "vite --host",
...
},
Open url
http://book.127-0-0-1.nip.io:5173/
<!-- this url will open ip 127.0.0.1:5173 -->
Create story
Example.story.vue
<!-- should will appear on http://book.127-0-0-1.nip.io:5173/ -->
<!-- for open component to new window, just rigth click on created story and open -->
source code and example
https://github.com/wildwind123/vitebook
0.0.21
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago
0.0.0
2 years ago