Gathering detailed insights and metrics for broccoli-asset-rev
Gathering detailed insights and metrics for broccoli-asset-rev
Gathering detailed insights and metrics for broccoli-asset-rev
Gathering detailed insights and metrics for broccoli-asset-rev
Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
npm install broccoli-asset-rev
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
86 Stars
185 Commits
83 Forks
9 Watching
2 Branches
41 Contributors
Updated on 15 Aug 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-30.8%
16,768
Compared to previous day
Last week
-15%
100,898
Compared to previous week
Last month
15.4%
496,567
Compared to previous month
Last year
-10.6%
5,745,714
Compared to previous year
Broccoli plugin to add fingerprint checksums to your files and update the source to reflect the new filenames.
Turns
<script src="assets/appname.js">
background: url('/images/foo.png');
Into
<script src="https://subdomain.cloudfront.net/assets/appname-342b0f87ea609e6d349c7925d86bd597.js">
background: url('https://subdomain.cloudfront.net/images/foo-735d6c098496507e26bb40ecc8c1394d.png');
1npm install broccoli-asset-rev --save-dev
1var AssetRev = require('broccoli-asset-rev'); 2 3var assetNode = new AssetRev(node, { 4 extensions: ['js', 'css', 'png', 'jpg', 'gif'], 5 exclude: ['fonts/169929'], 6 replaceExtensions: ['html', 'js', 'css'], 7 prepend: 'https://subdomain.cloudfront.net/' 8});
extensions
- Default: ['js', 'css', 'png', 'jpg', 'gif', 'map']
- The file types to add md5 checksums.exclude
- Default: []
- An array of globs. If a filename contains any item in the exclude array, it will not be fingerprinted.replaceExtensions
- Default: ['html', 'css', 'js']
- The file types to replace source code with new checksum file names.prepend
- Default: ''
- A string to prepend to all of the assets. Useful for CDN urls like https://subdomain.cloudfront.net/
generateRailsManifest
- Default: none - If true, will generate a manifest.json
to be used by Sprockets for the Rails Asset Pipeline. The manifest will be fingerprinted by default but this can be avoided by adding 'manifest.json'
to the exclude
list.railsManifestPath
- Default: 'assets/manifest-HASH.json'
- The path in the destination folder to store the Rails manifest. Only for the default value, HASH
will be replace with the fingerprint of the file.customHash
- Default: none - If set, overrides the md5 checksum calculation with the result of calling customHash(buffer, pathToFile)
. If it is not a function
, customHash
is used as the hash value. If it is set to null
, fingerprinting is skipped and only prepending occurs.generateAssetMap
- Default: false. If true, will generate a assetMap.json
file in a assets
directory on the output node. This file contains a mapping of the original asset name to the fingerprinted asset, like the following:assetMapPath
- Default: 'assets/assetMap-HASH.json'
- The path in the destination folder to store the assetMap.json
in. Only for the default value, HASH
will be replace with the fingerprint of the file.1{ 2 assets: { 3 css/file1.css: css/file1-sdaa7d6a87d6ada78ds.css, 4 images/image1.png: images/image1-sdaa7d6a87d6ada78ds.css, 5 } 6}
fingerprintAssetMap
- Default: false. If true, will fingerprint assetMap.json
.ignore
- Default: []
- An array of strings. If a filename contains any item in the ignore array, the contents of the file will not be processed for fingerprinting.annotation
- Default: null. A human-readable description for this plugin instance.The default settings are available if needed in your application or addon via:
var broccoliAssetRevDefaults = require( 'broccoli-asset-rev/lib/default-options' );
1var app = new EmberApp({
2 fingerprint: {
3 exclude: ['fonts/169929'],
4 prepend: 'https://sudomain.cloudfront.net/'
5 }
6});
enabled
- Default: app.env === 'production'
- Boolean. Enables fingerprinting if true. True by default if current environment is production.exclude
- Default: []
- An array of globs. If a filename contains any item in the exclude array, it will not be fingerprinted.extensions
- Default: ['js', 'css', 'png', 'jpg', 'gif', 'map']
- The file types to add md5 checksums.prepend
- Default: ''
- A string to prepend to all of the assets. Useful for CDN urls like https://subdomain.cloudfront.net/
replaceExtensions
- Default: ['html', 'css', 'js']
- The file types to replace source code with new checksum file names.Originally authored by @rickharrison
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 8/16 approved changesets -- score normalized to 5
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
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 2024-11-18
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