{"id":16671986,"url":"https://github.com/lekhmanrus/esbuild-pug","last_synced_at":"2026-05-09T05:33:25.497Z","repository":{"id":257822149,"uuid":"870836587","full_name":"lekhmanrus/esbuild-pug","owner":"lekhmanrus","description":"esbuild plugin to work with pug (jade) files","archived":false,"fork":false,"pushed_at":"2024-10-10T19:48:14.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T02:37:04.333Z","etag":null,"topics":["build-tool","build-tools","esbuild","esbuild-loader","esbuild-plugin","esbuild-plugins","hacktoberfest","html-template","html-template-engine","jade","javascript","plugin","plugins","pug","pugjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lekhmanrus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-10-10T18:53:48.000Z","updated_at":"2024-10-10T19:48:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2e9dc47-383f-4cd1-b266-02f0ab72fe7a","html_url":"https://github.com/lekhmanrus/esbuild-pug","commit_stats":null,"previous_names":["lekhmanrus/esbuild-pug"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lekhmanrus/esbuild-pug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lekhmanrus%2Fesbuild-pug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lekhmanrus%2Fesbuild-pug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lekhmanrus%2Fesbuild-pug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lekhmanrus%2Fesbuild-pug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lekhmanrus","download_url":"https://codeload.github.com/lekhmanrus/esbuild-pug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lekhmanrus%2Fesbuild-pug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32808471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["build-tool","build-tools","esbuild","esbuild-loader","esbuild-plugin","esbuild-plugins","hacktoberfest","html-template","html-template-engine","jade","javascript","plugin","plugins","pug","pugjs","typescript"],"created_at":"2024-10-12T12:04:38.816Z","updated_at":"2026-05-09T05:33:25.449Z","avatar_url":"https://github.com/lekhmanrus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eesbuild-pug\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/lekhmanrus/esbuild-pug/main/assets/esbuild-pug.svg\"\n       alt=\"esbuild-pug logo\" width=\"275px\" height=\"275px\" /\u003e\n  \u003cbr /\u003e\n  \u003cem\u003e\n    \u003ca href=\"https://esbuild.github.io/\" target=\"_blank\"\u003eesbuild\u003c/a\u003e plugin to work with \u003ca href=\"https://pugjs.org/\" target=\"_blank\"\u003epug\u003c/a\u003e (jade) files.\n  \u003c/em\u003e\n  \u003cbr /\u003e\n\u003c/p\u003e\n\n\n[![Build](https://github.com/lekhmanrus/esbuild-pug/actions/workflows/build.yaml/badge.svg)](https://github.com/lekhmanrus/esbuild-pug/actions/workflows/build.yaml)\n[![Publish](https://github.com/lekhmanrus/esbuild-pug/actions/workflows/publish.yaml/badge.svg)](https://github.com/lekhmanrus/esbuild-pug/actions/workflows/publish.yaml)\n[![codecov](https://codecov.io/gh/lekhmanrus/esbuild-pug/branch/main/graph/badge.svg?token=N9T5Q1CXLU)](https://codecov.io/gh/lekhmanrus/esbuild-pug)\n[![npm version](https://img.shields.io/npm/v/esbuild-pug.svg)](https://www.npmjs.com/package/esbuild-pug)\n[![npm](https://img.shields.io/npm/dm/esbuild-pug.svg)](https://www.npmjs.com/package/esbuild-pug)\n\n\n\u003chr /\u003e\n\n\n\n## Features\n\n- Compiles `.pug` and `.jade` files\n- Supports various configuration file formats\n- Integrates with esbuild seamlessly\n\n\n\n## Installation\n\n```sh\nnpm install --save-dev esbuild-pug\n```\n\n\n\n### Usage\n\n```ts\nimport { build } from 'esbuild';\nimport { pugPlugin } from 'esbuild-pug';\n\nbuild({\n  entryPoints: [ 'app.js' ],\n  bundle: true,\n  outfile: 'out.js',\n  plugins: [ pugPlugin() ],\n})\n  .catch(() =\u003e process.exit(1));\n```\n\n\n\n## Configuration\n\nYou can configure the plugin by passing options:\n\n```ts\npugPlugin({\n  basedir: './src/',\n  // other pug options\n})\n```\n\n\n### Options\n\nYou can configure your project to pass the additional options.\n\n\nThe plugin accepts all standard Pug options, plus:\n\n* `root`: Set the root directory for resolving includes and extends.\n* `loader`: Choose between `text` (default) or `js` output.\n\nYou can see the [supported options here](https://pugjs.org/api/reference.html).\n\n### Configuration File Formats\nesbuild-pug supports configuration files in several formats:\n\n* **JavaScript** - use `.pugrc.js` or `pug.config.js` and export an object containing your configuration.\n* **YAML** - use `.pugrc`, .`pugrc.yaml` or `.pugrc.yml` to define the configuration structure.\n* **JSON** - use `.pugrc.json` to define the configuration structure.\n* **package.json** - create an `pugConfig` property in your `package.json` file and define your configuration there.\n\nIf there are multiple configuration files in the same directory, esbuild-pug will only use one. The priority order is as follows:\n\n1. `package.json`\n2. `.pugrc`\n3. `.pugrc.json`\n4. `.pugrc.yaml`\n5. `.pugrc.yml`\n6. `.pugrc.js`\n7. `.pugrc.cjs`\n8. `pug.config.js`\n9. `pug.config.cjs`\n\n### Using Configuration Files\n\nHere's an example configuration file that sets Pug `basedir` option (again, [see whole list of supported options here](#options)):\n* `.pugrc.json` (JSON)\n  ```json\n  {\n    \"basedir\": \"./src/\"\n  }\n  ```\n\n* `.pugrc` (YAML)\n  ```yaml\n  basedir: ./src/\n  ```\n\n* `pug.config.js` (JavaScript)\n  ```js\n  module.exports = {\n    basedir: './src/'\n  };\n  ```\n\n**P.S.**: Either of that should work. No need to create all of them. [See Configuration File Formats](#configuration-file-formats).\n\n\n\n## Build\n\nRun `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory.\n\n\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flekhmanrus%2Fesbuild-pug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flekhmanrus%2Fesbuild-pug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flekhmanrus%2Fesbuild-pug/lists"}