{"id":20266326,"url":"https://github.com/julians/nunjucks-loader","last_synced_at":"2026-05-04T20:36:08.232Z","repository":{"id":35042711,"uuid":"199929449","full_name":"julians/nunjucks-loader","owner":"julians","description":"Nunjucks loader for webpack, supporting both javascript templating and generating static HTML files through the HtmlWebpackPlugin.","archived":false,"fork":false,"pushed_at":"2023-04-20T21:42:59.000Z","size":34,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T14:34:36.198Z","etag":null,"topics":["jinja","loader","nunjucks","template","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/julians.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":"2019-07-31T21:09:55.000Z","updated_at":"2021-03-24T13:03:12.000Z","dependencies_parsed_at":"2024-11-14T12:08:21.307Z","dependency_job_id":"c9a4c221-8fe0-4594-ae36-d79a8e73bb6c","html_url":"https://github.com/julians/nunjucks-loader","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"3ab57b7641d34da64090fa5b5948f677c8c87e25"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/julians/nunjucks-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julians%2Fnunjucks-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julians%2Fnunjucks-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julians%2Fnunjucks-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julians%2Fnunjucks-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julians","download_url":"https://codeload.github.com/julians/nunjucks-loader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julians%2Fnunjucks-loader/sbom","scorecard":{"id":541961,"data":{"date":"2025-08-11","repo":{"name":"github.com/julians/nunjucks-loader","commit":"3ab57b7641d34da64090fa5b5948f677c8c87e25"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-x77j-w7wf-fjmw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T08:24:32.574Z","repository_id":35042711,"created_at":"2025-08-20T08:24:32.574Z","updated_at":"2025-08-20T08:24:32.574Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32624337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["jinja","loader","nunjucks","template","webpack"],"created_at":"2024-11-14T12:08:16.572Z","updated_at":"2026-05-04T20:36:08.212Z","avatar_url":"https://github.com/julians.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nunjucks loader for Webpack\n\nNunjucks loader for webpack, supporting both javascript templating and generating static HTML files through the HtmlWebpackPlugin.\n\nOriginally forked from [SudoCat/Nunjucks-Isomorphic-Loader](https://github.com/SudoCat/Nunjucks-Isomorphic-Loader).\n\n## Installation\n\nThis loader needs [`nunjucks`](https://www.npmjs.com/package/nunjucks) as a peer dependency. Versions \u003e= 2.5.0 \u003c= 4.0.0 are accepted. If you do not have nunjucks already installed, first run:\n\nUsing yarn:\n\n```bash\nyarn add nunjucks -D\n```\n\nUsing npm:\n\n```bash\nnpm install nunjucks -D\n```\n\nIf you have nunjucks installed, you can then install the loader.\n\nUsing yarn:\n\n```bash\nyarn add @julians/nunjucks-loader -D\n```\n\nUsing npm:\n\n```bash\nnpm install @julians/nunjucks-loader -D\n```\n\n## Usage\n\nBasic usage of this loader with `html-webpack-plugin`\n\n```js\nmodule: {\n  rules: [\n    {\n      test: /\\.(njk|nunjucks|html|tpl|tmpl)$/,\n      use: [\n        {\n          loader: '@julians/nunjucks-loader',\n          query: {\n            root: [path.resolve(__dirname, 'path/to/templates/root')]\n          }\n        }\n      ]\n    }\n  ]\n},\n\nplugins: [\n  new HtmlWebpackPlugin({\n    customData: { foo: 'bar' },\n    filename: 'list.html',\n    template: 'path/to/template.nunjucks'\n  })\n]\n```\n\n## Requiring assets in templates\n\nUses regular Webpack loaders to load the required file, so you have to have them configured in your Webpack config.\n\n```nunjucks\n{{ \"src/assets/whatever.jpg\" | require }}\n```\n\n## Options\n\n```js\n// include specific templates\nincludeTemplates: [/.*\\.(njk|nunjucks|html|tpl|tmpl)$/],\n// enable jinja compatibility\njinjaCompat: true,\n// add custom filters\nfilters: {\n  obj_debug: function(variable) {\n    return JSON.stringify(variable, null, 2);\n  },\n},\n```\n\nAccessing data from the templates with the above config of `html-webpack-plugin`\n\n`path/to/template.njk` :\n\n```nunjucks\n{% set vars = htmlWebpackPlugin.options.customData %}\n\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003e{{ vars.foo }}\u003c/title\u003e{# outputs 'bar' #}\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cheader class=\"header\"\u003e\n    {% block header %}\n      \u003ch1 class=\"header-logo\"\u003e\n        \u003ca href=\"#\"\u003e{{ vars.foo }}\u003c/a\u003e{# outputs 'bar' #}\n      \u003c/h1\u003e\n    {% endblock %}\n    \u003c/header\u003e\n\n    {% block content %}\n      \u003csection\u003e\n        \u003cp\u003eI was generated with html-webpack-plugin and @julians/nunjucks-loader!\u003c/p\u003e\n      \u003c/section\u003e\n    {% endblock %}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulians%2Fnunjucks-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulians%2Fnunjucks-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulians%2Fnunjucks-loader/lists"}