vite-plugin-pug weekly downloads statistics
By SubZtep · npm · Vite plugins
Vite plugin for transform Pug templates into HTML
vite-plugin-pug has 27,124 recorded weekly downloads on npm, a decrease of 1.5% over the past 30 days, ranking #948 of 3,247 tracked listings.
About vite-plugin-pug
vite-plugin-pug
A plugin that makes Vite parse <pug src="example.pug"></pug> in your index.html. The rendered template replaces this tag with the compiled markup.
:information_source: Vue single file components don’t require this plugin, adding Pug to the dependency list is enough. — aka
npm i -D pug
Features
- CommonJS and ES module builds.
- Handle self-closing
pugtags. - Works with multiple
pugtags. - Generated TypeScript declarations.
- Reload when saving changes on a
.pugfile. - Support Pug local variables.
- Templates for multiple inputs.
- Experimental hot module reloading functionality.
- Handle adding or removing files.
Add to a project
Installation
Choose your appropriate choice:
$ npm i -D vite-plugin-pug
$ pnpm add -D vite-plugin-pug
$ yarn add -D vite-plugin-pug
Configuration
Create a vite.config.js configuration file and import the plugin:
// vite.config.(js|ts)
import { defineConfig } from "vite"
import pugPlugin from "vite-plugin-pug"
const options = { pretty: true } // FIXME: pug pretty is deprecated!
const locals = { name: "My Pug" }
export default defineConfig({
plugins: [pugPlugin(options, locals)],
})
Plugin Parameters
| Name | Required | Description |
|---|---|---|
| options | optional | Plugin options object. |
| locals | optional | Data object with Pug locals. |
Plugin Options
| Name | Required | Description |
|---|---|---|
| ... | optional | Anything from Pug options object. |
| localImports | optional | If true, use relative imports in the pug src attribute. |
Usage
Simple
Create a template file.
//- index.pug
h1 Hello World
p I'm a cool Vite project!
Embed pug tag with src attribute somewhere.
<!-- index.html -->
<html>
<body>
<pug src="index.pug" />
<script type="module" src="/main.ts"></script>
</body>
</html>
That's it.
:bulb: Check out its starter implementation in this repository.
Examples
Please find the examples folder in this repository.
Contribution
After Rollup I started to use Vite recently but this is not a reason to leave my beloved template format behind. Its lack of active Pug plugins made me make one quickly. It does the job to me, I will extend it when I need it. :suspect:
If it doesn't match with your setup please start a new discussion about it, I'm interested to see other workflows. If something is simply not working, please raise an issue. PRs certainly welcome! (.❛ ᴗ ❛.)
Description from the npm listing.
- vite
- vite-plugin
- pug
- jade
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 vite-plugin-pug alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-pug. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.