{"id":16736284,"url":"https://github.com/kagawagao/html-webpack-inject-plugin","last_synced_at":"2025-03-17T01:31:52.389Z","repository":{"id":28661734,"uuid":"119003264","full_name":"kagawagao/html-webpack-inject-plugin","owner":"kagawagao","description":"inject external tag to html","archived":false,"fork":false,"pushed_at":"2024-10-07T09:53:55.000Z","size":1820,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-10T00:06:24.050Z","etag":null,"topics":["external","html","plugin","webpack","webpack-plugin"],"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/kagawagao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-01-26T03:55:06.000Z","updated_at":"2024-10-07T09:53:52.000Z","dependencies_parsed_at":"2024-02-26T10:49:34.009Z","dependency_job_id":"f10c05a7-fbce-46ca-9406-4dec0ce7bfe8","html_url":"https://github.com/kagawagao/html-webpack-inject-plugin","commit_stats":{"total_commits":394,"total_committers":3,"mean_commits":"131.33333333333334","dds":0.1675126903553299,"last_synced_commit":"dc5f99313964f1071651cde89572eb4ad149e786"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagawagao%2Fhtml-webpack-inject-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagawagao%2Fhtml-webpack-inject-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagawagao%2Fhtml-webpack-inject-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kagawagao%2Fhtml-webpack-inject-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kagawagao","download_url":"https://codeload.github.com/kagawagao/html-webpack-inject-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243836015,"owners_count":20355615,"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":["external","html","plugin","webpack","webpack-plugin"],"created_at":"2024-10-13T00:08:54.679Z","updated_at":"2025-03-17T01:31:51.938Z","avatar_url":"https://github.com/kagawagao.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-webpack-inject-plugin\n\n[![node](https://img.shields.io/node/v/html-webpack-inject-plugin.svg)](https://www.npmjs.com/package/html-webpack-inject-plugin)\n[![npm](https://img.shields.io/npm/v/html-webpack-inject-plugin.svg)](https://www.npmjs.com/package/html-webpack-inject-plugin)\n[![license](https://img.shields.io/npm/l/html-webpack-inject-plugin.svg)](https://github.com/kagawagao/html-webpack-inject-plugin/blob/master/LICENSE)\n[![Build Status](https://travis-ci.org/kagawagao/html-webpack-inject-plugin.svg?branch=master)](https://travis-ci.org/kagawagao/html-webpack-inject-plugin)\n[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/)\n\ninject external tag to html\n\n## Installation\n\n```bash\nnpm install --save-dev html-webpack-inject-plugin\n```\n\n## Usage\n\nRequire the plugin in your webpack config\n\n```javascript\nimport HtmlWebpackInjectPlugin from 'html-webpack-inject-plugin'\n// or\nconst HtmlWebpackInjectPlugin = require('html-webpack-inject-plugin').default\n```\n\nAdd the plugin to your webpack config as follows\n\n```javascript\nplugins: [\n  new HtmlWebpackPlugin({\n    filename: 'index.html'\n  }),\n  new HtmlWebpackPlugin({\n    filename: 'other.html'\n  }),\n  new HtmlWebpackInjectPlugin({\n    externals: [\n      {\n        tagName: 'script',\n        attributes: {\n          src: 'common-script.js',\n          type: 'text/javascript'\n        }\n      },\n      {\n        tagName: 'script',\n        attributes: {\n          src: 'only-inject-to-other-script.js',\n          type: 'text/javascript'\n        },\n        include: ['other.html']\n      }\n    ],\n    prepend: true // default is false\n  })\n]\n```\n\n## Options\n\n- `externals: \u003cHtmlAssetItem\u003e[]`: external HTMLTagObject which you want to add\n- `prepend`: insert before parent first child\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagawagao%2Fhtml-webpack-inject-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkagawagao%2Fhtml-webpack-inject-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagawagao%2Fhtml-webpack-inject-plugin/lists"}