@cmmv/plugin-vite
v0.0.5
Published
Vite CMMV Plugins
Downloads
218
Readme
Description
@cmmv/plugin-vite
is a simple Vite plugin designed for handling .cmmv template files. It enables basic parsing and loading of templates, scripts, and styles, similar to Vue's SFC (Single File Component) format, but with a reduced scope tailored for lightweight component handling.
This plugin was inspired by the vite-plugin-vue
and allows for easy integration of .cmmv
files in Vite projects, focusing on simplicity and performance for component-based development.
Installation
$ pnpm add -D @cmmv/plugin-vite
Usage
// vite.config.js
import cmmvPlugin from '@cmmv/plugin-vite'
export default {
plugins: [cmmvPlugin()],
}
Example .cmmv File
<template>
<div>{{ message }}</div>
</template>
<script>
export default {
data() {
return {
message: 'Hello CMMV!'
};
}
};
</script>
<style>
div {
color: blue;
}
</style>