A vite plugin to enable you build websites in units using alpine.js
Check out the create-unit library for details.
npm i -D vite-plugin-unit
import unit from "vite-plugin-unit";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
unit({/* options */})
]
});
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 undersrc
folder containing the pages or routes -
options.slot
: string - The slot identifier in the template to be replaced by compiled .unit files
const defaultOptions = {
pages: "pages/",
template: "template.html",
slot: "#slot#"
};
Released under the MIT License
Copyright © 2024-present, Henry Hale