Gathering detailed insights and metrics for @principalstudio/html-webpack-inject-preload
Gathering detailed insights and metrics for @principalstudio/html-webpack-inject-preload
Gathering detailed insights and metrics for @principalstudio/html-webpack-inject-preload
Gathering detailed insights and metrics for @principalstudio/html-webpack-inject-preload
A html webpack plugin for injecting <link rel='preload'>
npm install @principalstudio/html-webpack-inject-preload
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (81.42%)
HTML (11.57%)
CSS (4%)
JavaScript (3.02%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
32 Stars
38 Commits
4 Forks
3 Watchers
1 Branches
2 Contributors
Updated on Mar 20, 2025
Latest Version
1.2.7
Package Id
@principalstudio/html-webpack-inject-preload@1.2.7
Unpacked Size
10.84 kB
Size
3.67 kB
File Count
5
NPM Version
7.6.0
Node Version
12.20.2
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
A HTML Webpack Plugin for injecting <link rel='preload'>
This plugin allows to add preload links anywhere you want.
You need to have HTMLWebpackPlugin v4 or v5 to make this plugin work.
npm i -D @principalstudio/html-webpack-inject-preload
webpack.config.js
1const HtmlWebpackPlugin = require('html-webpack-plugin'); 2const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); 3 4module.exports = { 5 entry: 'index.js', 6 output: { 7 path: __dirname + '/dist', 8 filename: 'index_bundle.js' 9 }, 10 plugins: [ 11 new HtmlWebpackPlugin(), 12 new HtmlWebpackInjectPreload({ 13 files: [ 14 { 15 match: /.*\.woff2$/, 16 attributes: {as: 'font', type: 'font/woff2', crossorigin: true }, 17 }, 18 { 19 match: /vendors\.[a-z-0-9]*.css$/, 20 attributes: {as: 'style' }, 21 }, 22 ] 23 }) 24 ] 25}
Options
rel="preload"
by default.Usage
The plugin is really simple to use. The plugin injects in headTags
, before any link, the preload elements.
For example
1<!DOCTYPE html> 2<html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Webpack App</title> 6 <%= htmlWebpackPlugin.tags.headTags %> 7 </head> 8 <body> 9 <script src="index_bundle.js"></script> 10 </body> 11</html>
will generate
1<!DOCTYPE html> 2<html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Webpack App</title> 6 <link href="dist/fonts/font.woff2" rel="preload" type="font/woff2" crossorigin> 7 <link href="dist/css/main.css"> 8 </head> 9 <body> 10 <script src="index_bundle.js"></script> 11 </body> 12</html>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/16 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
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