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 minze
bash
$ yarn add minze
bash
$ pnpm add minze
bash
$ bun add minze
- Set
keepNames
to true, to keep class names as is.
js
import { defineConfig } from 'vite'
export default defineConfig({
esbuild: {
keepNames: true
}
})
- Import
MinzeElement
and 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>