vite-plugin-unit
v1.0.0
Published
A vite plugin to enable you build websites in units.
Downloads
6
Maintainers
Readme
vite-plugin-unit
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 mountedoptions.pages
: string - The folder undersrc
folder containing the pages or routesoptions.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