{"id":37422955,"url":"https://github.com/kushtrimh/java-template-engine-webpack-plugin","last_synced_at":"2026-01-16T06:08:50.807Z","repository":{"id":40500542,"uuid":"424013903","full_name":"kushtrimh/java-template-engine-webpack-plugin","owner":"kushtrimh","description":"A plugin extension for html-webpack-plugin that injects code for Java template engines","archived":false,"fork":false,"pushed_at":"2023-04-16T09:56:32.000Z","size":157,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T09:50:10.639Z","etag":null,"topics":["java-template-engine","javascript","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/java-template-engine-webpack-plugin","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/kushtrimh.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}},"created_at":"2021-11-02T22:10:40.000Z","updated_at":"2023-02-21T21:19:39.000Z","dependencies_parsed_at":"2022-08-09T22:14:39.084Z","dependency_job_id":null,"html_url":"https://github.com/kushtrimh/java-template-engine-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kushtrimh/java-template-engine-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kushtrimh%2Fjava-template-engine-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kushtrimh%2Fjava-template-engine-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kushtrimh%2Fjava-template-engine-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kushtrimh%2Fjava-template-engine-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kushtrimh","download_url":"https://codeload.github.com/kushtrimh/java-template-engine-webpack-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kushtrimh%2Fjava-template-engine-webpack-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"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":["java-template-engine","javascript","webpack-plugin"],"created_at":"2026-01-16T06:08:50.170Z","updated_at":"2026-01-16T06:08:50.791Z","avatar_url":"https://github.com/kushtrimh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Template Engine Webpack Plugin\n[![npm_version](https://img.shields.io/npm/v/java-template-engine-webpack-plugin?color=blue)](https://www.npmjs.com/package/java-template-engine-webpack-plugin)\n![build workflow](https://github.com/kushtrimh/java-template-engine-webpack-plugin/actions/workflows/node.js.yml/badge.svg)\n\nA plugin extension for [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) that injects code for Java template engines.\n\n## Supported engines\n\n- Thymeleaf (`thymeleaf`)\n- Java Server Pages (`jsp`)\n\n## Installation\n\n`npm i --save-dev java-template-engine-webpack-plugin`\n\n## Usage\n\n```js\nconst HtmlWebpackPlugin = require('html-webpack-plugin')\nconst JavaTemplateEngineWebpackPlugin = require('java-template-engine-webpack-plugin');\n\nmodule.exports = {\n  entry: 'index.js',\n  output: {\n    path: __dirname + '/dist',\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new HtmlWebpackPlugin(),\n    new JavaTemplateEngineWebpackPlugin(HtmlWebpackPlugin, {engine: 'thymeleaf'})\n  ]\n}\n```\n\n---\n\nThe example below shows how the output of `index.html` is changed after adding the plugin with `thymeleaf` as the engine.\n\n*Before*\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eWebpack App\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"styles.css\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"root\"\u003e\u003c/div\u003e\n    \u003cscript src=\"bundle.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n*After*\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eWebpack App\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" th:href=\"@{styles.css}\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"root\"\u003e\u003c/div\u003e\n    \u003cscript th:src=\"@{bundle.js}\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n---\n\n### Options\n|Name|Type|Default|Description|\n|--------|---------|--------|---------|\n|`engine`|`String`|`''`|The engine to be used, please check [supported engines](#supported-engines) section.|\n|`addLeadingSlash`|`Boolean`|`false`|Adds a leading slash to the attribute if its missing. \u003cbr /\u003e _static/image.png_ becomes _/static/image.png_|\n|`removeLeadingSlash`|`Boolean`|`false`|Removes a leading slash from the attribute if its present. \u003cbr /\u003e _/static/image.png_ becomes _static/image.png_|\n|`removeDotSegments`|`Boolean`|`false`|Removes dot-segments from the attribute. \u003cbr /\u003e _../../static/image.png_ becomes _static/image.png_ \u003cbr /\u003e _./static/image.png_ becomes _static/image.png_ \u003cbr /\u003e _.static/image.png_ becomes _static/image.png_|\n|`removeOriginalAttributes`|`Boolean`|`true`|Removes the original `src` and `href` attributes. Only valid when using `thymeleaf` engine.|\n|`useJSTL`|`Boolean`|`true`|Uses the `JSTL` `\u003cc:url\u003e` tag when modifying attributes. Only valid when using `jsp` engine.|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkushtrimh%2Fjava-template-engine-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkushtrimh%2Fjava-template-engine-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkushtrimh%2Fjava-template-engine-webpack-plugin/lists"}