Installations
npm install static-version-injection-html-webpack-plugin
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
6.10.3
NPM Version
3.10.10
Score
68.8
Supply Chain
96.7
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Kat5ura
Download Statistics
Total Downloads
2,683
Last Day
2
Last Week
2
Last Month
14
Last Year
165
GitHub Statistics
3 Stars
17 Commits
2 Watching
1 Branches
1 Contributors
Package Meta Information
Latest Version
0.0.8
Package Id
static-version-injection-html-webpack-plugin@0.0.8
Size
7.65 kB
NPM Version
3.10.10
Node Version
6.10.3
Total Downloads
Cumulative downloads
Total Downloads
2,683
Last day
0%
2
Compared to previous day
Last week
-75%
2
Compared to previous week
Last month
600%
14
Compared to previous month
Last year
-30.4%
165
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Add file version after the assets` src for the HTML Webpack Plugin
This plugin allows you to add a version string for each static asset in the output from html-webpack-plugin.
Installation
You must be running webpack on node 4.x or higher
Install the plugin with npm:
1$ npm install --save-dev static-version-injection-html-webpack-plugin
Basic Usage
Require the plugin in your webpack config:
1var StaticVersionInjectionPlugin = require('static-version-injection-html-webpack-plugin');
Add the plugin to your webpack config as follows:
1plugins: [ 2 new HtmlWebpackPlugin(), 3 new StaticVersionInjectionPlugin({md5: true }) 4]
Options
The available options are:
-
md5
:boolean
Specifying whether to use md5 version for all static assets or not.
Example
Using HtmlWebpackIncludeAssetsPlugin
and CopyWebpackPlugin
to include assets to html-webpack-plugin
template :
1{ 2// ... 3output: { 4 filename: utils.assetsPath('js/[name].[chunkhash].js'), 5 // or 6 // filename: utils.assetsPath('js/[name].js') 7 8 } 9// ... 10plugins: [ 11 // extract css into its own file 12 new ExtractTextPlugin({ 13 filename: utils.assetsPath('css/[name].[contenthash].css') 14 // or 15 // filename: utils.assetsPath('css/[name].[contenthash].css') 16 17 }), 18 new HtmlWebpackPlugin(), 19 new StaticVersionInjectionPlugin() 20] 21}
User md5 mode :
1plugins: [ 2 new HtmlWebpackPlugin(), 3 new StaticVersionInjectionPlugin({ 4 md5: true 5 }) 6]
Then you will get html like this
1<!DOCTYPE html> 2<html> 3<head> 4 <meta charset=utf-8> 5 <title>test1</title> 6 <link href="/static/css/app.css?v=ce027eb1c4fdfea5bce4f5e466a381dd" rel=stylesheet> 7</head> 8 9<body> 10 <div id=app></div> 11 <script type=text/javascript src="/static/js/manifest.js?v=8072eace45064bc08e5f"></script> 12 <script type=text/javascript src="/static/js/vendor.js?v=5953645b5f4b4a670ad7"></script> 13 <script type=text/javascript src="/static/js/app.js?v=6b6c95749ad1049c0c72"></script> 14</body> 15</html>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2024-12-23
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