@marlonmarcello/vite-plugin-pug
v1.0.3
Published
This plugin adds support for the Pug template engine to Vite.
Downloads
2
Readme
@marlonmarcello/vite-plugin-pug
This plugin adds support for the Pug template engine to Vite.
Install
npm install --save-dev @marlonmarcello/vite-plugin-pug
Usage
Add @marlonmarcello/vite-plugin-pug
to your Vite config file:
// vite.config.js
import vitePluginPug from "@marlonmarcello/vite-plugin-pug";
export default {
plugins: [vitePluginPug()],
};
Options
You can pass all default Pug Options plus:
data: object
- Any data that you would like available globaly to templates
Example
import vitePluginPug from "@marlonmarcello/vite-plugin-pug";
export default {
plugins: [
vitePluginPug({
data: {
meta: {
title: "My awesome website",
},
},
}),
],
};
doctype html
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
title!=meta.title
body
//- template