Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henryhale/vite-plugin-unit
🟨 A vite plugin for building websites in units.
https://github.com/henryhale/vite-plugin-unit
component-based henryhale js ts unit-js vite vite-plugin
Last synced: 3 days ago
JSON representation
🟨 A vite plugin for building websites in units.
- Host: GitHub
- URL: https://github.com/henryhale/vite-plugin-unit
- Owner: henryhale
- License: mit
- Created: 2024-01-06T01:36:53.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-06-06T07:07:19.000Z (5 months ago)
- Last Synced: 2024-10-07T20:17:03.842Z (about 1 month ago)
- Topics: component-based, henryhale, js, ts, unit-js, vite, vite-plugin
- Language: TypeScript
- Homepage:
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# vite-plugin-unit
[![npm](https://img.shields.io/npm/v/vite-plugin-unit.svg?style=for-the-badge)](https://www.npmjs.com/package/vite-plugin-unit)
A vite plugin to enable you build websites in units.
Check out the [create-unit](https://github.com/henryhale/create-unit) library for details.
## installation
```sh
npm i -D vite-plugin-unit
```## usage
```js
import unit from "vite-plugin-unit";
import { defineConfig } from "vite";export default defineConfig({
plugins: [
unit({/* options */})
]
});
```## configuration
```ts
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
```js
const defaultOptions = {
pages: "pages/",
template: "template.html",
slot: ""
};
```## License
Released under the [MIT License](./LICENSE.md)
Copyright © 2024-present, [Henry Hale](https://github.com/henryhale)