vite-plugin-unit
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

vite-plugin-unit

npm

A vite plugin to enable you build websites in units using alpine.js

Check out the create-unit library for details.

installation

npm i -D vite-plugin-unit

usage

import unit from "vite-plugin-unit";
import { defineConfig } from "vite";

export default defineConfig({
    plugins: [
        unit({/* options */})
    ]
});

configuration

type PluginOptions = {
    pages: string;
    template: string;
    slot: string;
};
  • options.template: string - The HTML file in which compiles .unit files will be mounted
  • options.pages: string - The folder under src folder containing the pages or routes
  • options.slot: string - The slot identifier in the template to be replaced by compiled .unit files

default options

const defaultOptions = {
    pages: "pages/",
    template: "template.html",
    slot: "#slot#"
};

License

Released under the MIT License

Copyright © 2024-present, Henry Hale

Package Sidebar

Install

npm i vite-plugin-unit

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

15.3 kB

Total Files

5

Last publish

Collaborators

  • devhenryhale