Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
broccoli-asset-rewrite
Advanced tools
#broccoli-asset-rewrite
Broccoli plugin to rewrite a source tree from an asset map.
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');
npm install broccoli-asset-rewrite --save-dev
The asset map should have keys of the original names and values of the new names.
var assetRewrite = require('broccoli-asset-rewrite');
var generatedMap = {
'assets/appname.css': 'assets/appname-d1d59e0fdcfc183415ab0b72a4f78d9c.css',
'assets/appname.js': 'assets/appname-ed50537fcd5a71113cf79908f49e854d.js',
'assets/vendor.css': 'assets/vendor-d41d8cd98f00b204e9800998ecf8427e.css',
'logo.png': 'logo-c4ab8191636f0a520d1f7f7a82c455a3.png'
};
var assetTree = assetRewrite(tree, {
assetMap: generatedMap,
replaceExtensions: ['html', 'js', 'css'],
prepend: 'https://subdomain.cloudfront.net/'
});
assetMap
- Default: {}
- The asset map to rewrite source from.replaceExtensions
- Default: ['html', 'css']
- 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/
ignore
- Default: []
- Ignore files from being rewritten.FAQs
broccoli plugin to rewrite a source tree from an asset map.
The npm package broccoli-asset-rewrite receives a total of 83,785 weekly downloads. As such, broccoli-asset-rewrite popularity was classified as popular.
We found that broccoli-asset-rewrite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.