🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

broccoli-asset-rev

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-asset-rev

broccoli asset revisions (fingerprint)

3.0.0
latest
Source
npm
Version published
Weekly downloads
165K
2.17%
Maintainers
5
Weekly downloads
 
Created

What is broccoli-asset-rev?

The broccoli-asset-rev npm package is used for asset revisioning in Broccoli.js builds. It appends a content hash to filenames, which helps with cache busting by ensuring that users always get the latest version of the assets.

What are broccoli-asset-rev's main functionalities?

Asset Revisioning

This feature appends a content hash to the filenames of specified asset types (e.g., JS, CSS, images). The 'extensions' option specifies which file types to hash, and the 'replaceExtensions' option specifies which file types should have their references updated.

const assetRev = require('broccoli-asset-rev');
const tree = assetRev('path/to/assets', {
  extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map'],
  replaceExtensions: ['html', 'css', 'js']
});

Custom Fingerprint Generation

This feature allows you to define a custom function for generating the hash that will be appended to the filenames. The 'customHash' option takes a function that returns the desired hash.

const assetRev = require('broccoli-asset-rev');
const tree = assetRev('path/to/assets', {
  customHash: function(file) {
    return 'custom-hash';
  }
});

Exclude Specific Files

This feature allows you to exclude specific files or directories from being processed. The 'exclude' option takes an array of file paths or glob patterns.

const assetRev = require('broccoli-asset-rev');
const tree = assetRev('path/to/assets', {
  exclude: ['excluded-file.js', 'excluded-directory/*']
});

Other packages similar to broccoli-asset-rev

Keywords

broccoli

FAQs

Package last updated on 13 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts