{"id":20163413,"url":"https://github.com/sjinks/hwp-attributes-plugin","last_synced_at":"2025-04-10T00:36:50.763Z","repository":{"id":36978467,"uuid":"268370016","full_name":"sjinks/hwp-attributes-plugin","owner":"sjinks","description":"Plugin to add various attributes to script tags injected by html-webpack-plugin","archived":false,"fork":false,"pushed_at":"2025-03-03T05:53:39.000Z","size":3192,"stargazers_count":0,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T05:02:22.265Z","etag":null,"topics":["html-attributes","html-webpack-plugin","html-webpack-plugin-plugin","script-tag","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hwp-attributes-plugin","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/sjinks.png","metadata":{"funding":{"custom":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"]},"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":"2020-05-31T21:49:03.000Z","updated_at":"2025-03-03T05:53:26.000Z","dependencies_parsed_at":"2023-12-24T10:24:40.481Z","dependency_job_id":"f765ac71-c93a-41d2-aa9c-b6ed85fa0644","html_url":"https://github.com/sjinks/hwp-attributes-plugin","commit_stats":{"total_commits":479,"total_committers":8,"mean_commits":59.875,"dds":0.6367432150313153,"last_synced_commit":"aa9a8007fabd063e0146ee86353067ae04bb77e1"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fhwp-attributes-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fhwp-attributes-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fhwp-attributes-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjinks%2Fhwp-attributes-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjinks","download_url":"https://codeload.github.com/sjinks/hwp-attributes-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138002,"owners_count":21053774,"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":["html-attributes","html-webpack-plugin","html-webpack-plugin-plugin","script-tag","webpack-plugin"],"created_at":"2024-11-14T00:29:30.470Z","updated_at":"2025-04-10T00:36:50.730Z","avatar_url":"https://github.com/sjinks.png","language":"TypeScript","readme":"# hwp-attributes-plugin\n\n[![Build and Test](https://github.com/sjinks/hwp-attributes-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/sjinks/hwp-attributes-plugin/actions/workflows/build.yml)\n[![CodeQL](https://github.com/sjinks/hwp-attributes-plugin/actions/workflows/codeql.yml/badge.svg)](https://github.com/sjinks/hwp-attributes-plugin/actions/workflows/codeql.yml)\n\nPlugin to add various attributes to script tags injected by [html-webpack-plugin](https://www.npmjs.com/package/html-webpack-plugin)\n\n## Installation\n\n```shell\nnpm i -D hwp-attributes-plugin\n```\n\n## Usage\n\n```js\nimport { HwpAttributesPlugin } from 'hwp-attributes-plugin';\n\n// Webpack configuration object\nexport default {\n\n    plugins: [\n        new HtmlWebpackPlugin({ /* ... */ }),\n        new HwpAttributesPlugin({\n            module: ['**.mjs'],\n            nomodule: ['polyfills.js'],\n            async: ['some-async-script.js', 'another-async-script.js'],\n            defer: ['script-to-defer.*.js'],\n        }),\n    ],\n};\n```\n\nTo configure the plugin, pass an object with the following keys to its constructor (all keys are optional):\n  * `module`: patterns of scripts that should have the `module` attribute added;\n  * `nomodule`: patterns of scripts that should have the `nomodule` attribute added;\n  * `async`: patterns of scripts that should have the `async` attribute added;\n  * `defer`: patterns of scripts that should have the `defer` attribute added.\n\nThe plugin performs pattern matching with the help of [minimatch](https://www.npmjs.com/package/minimatch).\n\nThe `module` and `nomodule` attributes are mutually exclusive, `module` takes precedence. If the same file matches both `module` and `nomodule` patterns, it will have the `module` attribute.\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=SAG6877JDJ3KU","https://send.monobank.ua/jar/7rosVfiwKM"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fhwp-attributes-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjinks%2Fhwp-attributes-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjinks%2Fhwp-attributes-plugin/lists"}