@cmmv/plugin-vite
v0.0.2
Published
<p align="center"> <a href="https://cmmv.io/" target="blank"><img src="https://raw.githubusercontent.com/andrehrferreira/docs.cmmv.io/main/public/assets/logo_CMMV2_icon.png" width="300" alt="CMMV Logo" /></a> </p> <p align="center">Contract-Model-Mod
Downloads
7
Readme
@cmmv/plugin-vite
@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>
Documentation
The complete documentation is available here.
Status
- This is pretty new. There are probably bugs and there might still be API changes, so use at your own risk. Is it usable though? Very much. Check out the examples to see what it's capable of.
Stay in Touch
- Author - André Ferreira
- Twitter - @andrehrferreira
- Linkdin - @andrehrf
- Youtube - @Andrehrferreira
License
CMMV is MIT licensed.