Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

A Vite plugin for treeshaking PrimeVue components

Notifications You must be signed in to change notification settings

SergkeiM/vite-plugin-primevue

Repository files navigation

vite-plugin-primevue

Very simple Vite plugin for automatic imports of PrimeVue. Ported from vite-plugin-vuetify that was created by @KaelWD

Automatic imports

// vite.config.js
import primevue from '@froxz/vite-plugin-primevue'

plugins: [
  vue(),
  primeVue()
]

Options

// vite.config.js
import primevue from '@froxz/vite-plugin-primevue'

plugins: [
  vue(),
  primeVue({
    sfc: true // Read: https://www.primefaces.org/primevue/setup (Single File Components)
  })
]

Caveats

When using this plugin you can define componets in your template as camel, kebab, or lower case, all will produce same result example:

<template>
    <InputSwitch/>
    <input-switch/>
    <inputswitch/>
</template>

Exceptions (Components that have same name as HTML elements:

<template>
    <Button/> //should be defined as Capitilize
</template>