0.2.9 • Published 9 months ago
@viteplay/plugin v0.2.9
@viteplay/plugin
Setup
Shorthand version
// vite.config.ts
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import viteplay from "@viteplay/plugin"
export default defineConfig({
plugins: [
vue(),
viteplay({
// Path to extract components from
components: "./components/*/*.vue",
// Path to extract examples from, relative to component path
componentExamples: "./examples/*.vue",
// base route for the development pages
base: "/dev",
}),
],
})
Longhand version
// vite.config.ts
import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import viteplay from "@viteplay/plugin"
export default defineConfig({
plugins: [
vue(),
viteplay({
pages: [
{
title: "My Button", // (Optional) defaults to the component name
component: "./button/MyButton.vue",
examples: "./button/*.example.vue",
},
{
title: "My Form", // (Optional) defaults to the component name
component: "./form/MyForm.vue",
examples: "./form/*.example.vue",
},
],
// base route for the development pages
base: "/dev",
}),
],
})
Add to Vue Router
import { createRouter } from "vue-router"
import { pages as pagesVitePlay } from "@viteplay/vue/client"
console.log(`VitePlay development routes → `, pagesVitePlay)
export const router = createRouter({
routes: [
...pagesVitePlay,
// your other routes here...
],
})
0.2.9
9 months ago
0.2.7
12 months ago
0.2.6
12 months ago
0.2.8
12 months ago
0.2.5
12 months ago
0.2.3
2 years ago
0.2.2
2 years ago
0.2.4
2 years ago
0.1.0
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.0.27
2 years ago
0.0.26
2 years ago
0.0.21
2 years ago
0.0.22
2 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.25
2 years ago
0.0.20
2 years ago
0.0.12
2 years ago
0.0.13
2 years ago
0.0.15
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.18
2 years ago
0.0.19
2 years ago
0.0.10
2 years ago
0.0.11
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.5
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.3
2 years ago
0.0.1
2 years ago
0.0.1-alpha.1
2 years ago
0.0.0-alpha.4
2 years ago
0.0.0-alpha.3
2 years ago
0.0.0-alpha.2
2 years ago
0.0.0-alpha.1
2 years ago
0.0.0-alpha.0
2 years ago