Gathering detailed insights and metrics for rollup-plugin-generate-html-template-custom
Gathering detailed insights and metrics for rollup-plugin-generate-html-template-custom
Gathering detailed insights and metrics for rollup-plugin-generate-html-template-custom
Gathering detailed insights and metrics for rollup-plugin-generate-html-template-custom
Rollup plugin for automatically injecting a script tag with the final bundle into an html file.
npm install rollup-plugin-generate-html-template-custom
Typescript
Module System
Node Version
NPM Version
HTML (93.69%)
JavaScript (5.18%)
CSS (1.13%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
60 Stars
73 Commits
19 Forks
1 Watchers
19 Branches
10 Contributors
Updated on Aug 25, 2024
Latest Version
1.6.5
Package Id
rollup-plugin-generate-html-template-custom@1.6.5
Unpacked Size
163.57 kB
Size
38.29 kB
File Count
7
NPM Version
6.14.1
Node Version
13.9.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Auto-inject the resulting rollup bundle via a script
tag into a HTML template.
1npm install --save-dev rollup-plugin-generate-html-template
1// rollup.config.js 2import htmlTemplate from 'rollup-plugin-generate-html-template'; 3 4export default { 5 entry: 'src/index.js', 6 dest: 'dist/js/bundle.js', 7 plugins: [ 8 htmlTemplate({ 9 template: 'src/template.html', 10 target: 'index.html', 11 }), 12 ], 13};
On final bundle generation the provided template file will have a script
tag injected directly above the closing body
tag with a link to the js bundle. By default it uses the same file name and places it directly next to the JS bundle.
1<!-- src/index.html --> 2<html> 3<body> 4 <canvas id="main"></canvas> 5</body> 6</html> 7 8<!-- dist/index.html --> 9<html> 10<body> 11 <canvas id="main"></canvas> 12 <script src="bundle.js"></script> 13</body> 14</html>
template
: (required) The path to the source template.target
: The directory and file name to use for the html file generated with the bundle.attrs
: The attributes provided to the generated bundle script tag. Passed as an array of strings
Example: attrs: ['async', 'defer]
will generate <script async defer src="bundle.js"></script>
replaceVars
: An object containing variables that will be replaced in the generated html.
Example: replaceVars: { '__CDN_URL__': process.env.NODE_ENV === 'production' ? 'https://mycdn.com' : '' }
will replace all instances of __CDN_URL__
with http://mycdn.com
if the environment is productionMIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/17 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
73 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More