hash-content-html-webpack-plugin
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "hash-content-html-webpack-plugin", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -10,3 +10,6 @@ "main": "src/index.js", | ||
"author": "", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"dependencies": { | ||
"hasha": "^3.0.0" | ||
} | ||
} |
@@ -1,1 +0,28 @@ | ||
const test = 1 | ||
const hasha = require('hasha') | ||
module.exports = class ContentHash { | ||
apply(compiler) { | ||
compiler.plugin('compilation', (compilation) => { | ||
compilation.plugin( | ||
'html-webpack-plugin-after-emit', | ||
({ outputName, html }) => { | ||
const chunk = compilation.assets[outputName] | ||
const hash = hasha(html.source(), { | ||
algorithm: 'md5' | ||
}).substring(0, 20) | ||
const name = outputName.replace(/\[contenthash\]/g, hash) | ||
compilation.assets[name] = chunk | ||
delete compilation.assets[outputName] | ||
} | ||
) | ||
}) | ||
} | ||
} | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
929
3
19
1
2
0
1
+ Addedhasha@^3.0.0
+ Addedhasha@3.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)