{"id":14967586,"url":"https://github.com/subztep/vite-plugin-pug","last_synced_at":"2025-04-16T02:22:09.456Z","repository":{"id":40566278,"uuid":"338343286","full_name":"SubZtep/vite-plugin-pug","owner":"SubZtep","description":"Vite plugin for transform Pug templates into HTML","archived":false,"fork":false,"pushed_at":"2024-09-29T18:35:17.000Z","size":457,"stargazers_count":49,"open_issues_count":10,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T04:06:14.202Z","etag":null,"topics":["jade","pug","vite","vite-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vite-plugin-pug","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SubZtep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-12T14:34:52.000Z","updated_at":"2025-01-22T08:17:04.000Z","dependencies_parsed_at":"2024-06-18T16:46:28.802Z","dependency_job_id":"0fdd1863-b57b-41b4-978b-76213f56fd6b","html_url":"https://github.com/SubZtep/vite-plugin-pug","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":"0.15000000000000002","last_synced_commit":"58f763456310a8b04de59c2744638dbb737a3d50"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubZtep%2Fvite-plugin-pug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubZtep%2Fvite-plugin-pug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubZtep%2Fvite-plugin-pug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SubZtep%2Fvite-plugin-pug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SubZtep","download_url":"https://codeload.github.com/SubZtep/vite-plugin-pug/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249183832,"owners_count":21226267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jade","pug","vite","vite-plugin"],"created_at":"2024-09-24T13:38:19.101Z","updated_at":"2025-04-16T02:22:09.439Z","avatar_url":"https://github.com/SubZtep.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-pug\n\n![test](https://github.com/SubZtep/vite-plugin-pug/workflows/npm%20test/badge.svg)\n\nA plugin that makes [Vite](https://vitejs.dev/) parse `\u003cpug src=\"example.pug\"\u003e\u003c/pug\u003e` in your `index.html`. The rendered template replaces this tag with the compiled markup.\n\n\u003e :information_source: **Vue** single file components don’t require this plugin, adding [Pug](https://www.npmjs.com/package/pug) to the dependency list is enough. — aka `npm i -D pug`\n\n## Features\n\n- [x] CommonJS and ES module builds.\n- [x] Handle self-closing `pug` tags.\n- [x] Works with multiple `pug` tags.\n- [x] Generated _TypeScript_ declarations.\n- [x] Reload when saving changes on a `.pug` file.\n- [x] Support Pug local variables.\n- [x] Templates for multiple inputs.\n- [ ] _Experimental hot module reloading functionality._\n- [ ] _Handle adding or removing files._\n\n## Add to a project\n\n### Installation\n\nChoose your appropriate choice:\n\n```sh\n$ npm i -D vite-plugin-pug\n$ pnpm add -D vite-plugin-pug\n$ yarn add -D vite-plugin-pug\n```\n\n### Configuration\n\nCreate a `vite.config.js` [configuration file](https://vitejs.dev/config/) and import the plugin:\n\n```js\n// vite.config.(js|ts)\nimport { defineConfig } from \"vite\"\nimport pugPlugin from \"vite-plugin-pug\"\n\nconst options = { pretty: true } // FIXME: pug pretty is deprecated!\nconst locals = { name: \"My Pug\" }\n\nexport default defineConfig({\n  plugins: [pugPlugin(options, locals)],\n})\n```\n\n### Plugin Parameters\n\n| Name    | Required | Description                               |\n| ------- | -------- | ----------------------------------------- |\n| options | optional | [Plugin options](#plugin-options) object. |\n| locals  | optional | Data object with Pug locals.              |\n\n### Plugin Options\n\n| Name         | Required | Description                                                                       |\n| ------------ | -------- | --------------------------------------------------------------------------------- |\n| ...          | optional | Anything from [Pug options](https://pugjs.org/api/reference.html#options) object. |\n| localImports | optional | If `true`, use relative imports in the pug src attribute.                         |\n\n## Usage\n\n### Simple\n\nCreate a template file.\n\n```pug\n//- index.pug\nh1 Hello World\np I'm a cool Vite project!\n```\n\nEmbed `pug` tag with `src` attribute somewhere.\n\n```html\n\u003c!-- index.html --\u003e\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cpug src=\"index.pug\" /\u003e\n    \u003cscript type=\"module\" src=\"/main.ts\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThat's it.\n\n\u003e :bulb: Check out **its starter** implementation [in this repository](https://github.com/SubZtep/css-tetris-3d).\n\n## Examples\n\nPlease find the [examples](examples/) folder in this repository.\n\n## Contribution\n\n~~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](https://github.com/marlonmarcello/vite-plugin-pug) Pug plugins made me make one quickly. It does the job to me, I will extend it when I need it. :suspect:\n\nIf it doesn't match with your setup please [start a new discussion](https://github.com/SubZtep/vite-plugin-pug/discussions/new) about it, I'm interested to see other workflows. If something is simply not working, please [raise an issue](https://github.com/SubZtep/vite-plugin-pug/issues/new). **PRs certainly welcome!** (.❛ ᴗ ❛.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubztep%2Fvite-plugin-pug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubztep%2Fvite-plugin-pug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubztep%2Fvite-plugin-pug/lists"}