Vite
The default Minze dev environment runs with Vite. If you want to build a components library have a look at the CLI Installation Guide or the Vite Template in the Minze repo.
If you want to add Minze to a fresh Vite project follow these steps:
- Install dependencies.
bash
$ npm add minzebash
$ yarn add minzebash
$ pnpm add minzebash
$ bun add minze- Set
keepNamesto true, to keep class names as is.
js
import { defineConfig } from 'vite'
export default defineConfig({
esbuild: {
keepNames: true
}
})- Import
MinzeElementand define a component.
js
import { MinzeElement } from 'minze'
class MyElement extends MinzeElement {
html = () => 'Hello Minze!'
}
MyElement.define()- Add the component to any of your markup templates.
html
<my-element></my-element>