Dynamically render pages using custom template engines instead of the static
.html
entry file.
For detailed usage instructions and API references, please visit the official documentation:
The plugin supports 59 template engines (sorted alphabetically):
- arc-templates
- atpl
- bracket
- dot
- dust
- eco
- ejs
- ect
- haml
- haml-coffee
- hamlet
- handlebars
- hogan
- htmling
- jade
- jazz
- jqtpl
- just
- liquid
- liquor
- lodash
- marko
- mote
- mustache
- nunjucks
- plates
- pug
- qejs
- ractive
- razor
- react
- slm
- squirrelly
- swig
- teacup
- templayed
- toffee
- twig
- underscore
- vash
- velocityjs
- walrus
- whiskers
npm i -D vite-plugin-view <template-engine-name>
Replace
<template-engine-name>
with any engine from the list above (e.g.,pug
orejs
).
Configure the plugin in vite.config.js
:
import { defineConfig } from 'vite';
import { view } from 'vite-plugin-view';
export default defineConfig({
plugins: [
view({
engine: 'pug', // Set the template engine to use (e.g., 'pug', 'ejs', etc.)
})
]
});
We welcome contributions from the community! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a new branch for your changes.
- Submit a pull request with a clear description of your changes.
This project is licensed under the MIT License.