Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
hashed-map-webpack-plugin
Advanced tools
Map the filepaths of files output by a webpack compilation from their hashed version to their unhashed version.
This plugin maps the filepaths of files output by a webpack compilation from their hashed version to their unhashed version.
{
"/site.js": "https://assets.my-site.com/site.123123.js",
"/images/edison.jpg": "https://assets.my-site.com/images/edison.123123.jpg",
"/site.css": "https://assets.my-site.com/site.123123.css"
}
npm install hashed-map-webpack-plugin --save-dev
In your webpack config include the plug-in. And add it to your config:
var path = require('path')
var HashedMapPlugin = require('hashed-map-webpack-plugin')
module.exports = {
plugins: [HashedMapPlugin(), ...]
output: {
path: path.join(__dirname, '../www'),
filename: '[path].[name].[hash].js',
publicPath: 'https://assets.my-site.com/'
},
...
}
You can pass the following options:
exclude
Regex to match for excluded content.
filepath
Where to save the JSON file output by the plugin.
Optional. static-assets.json
by default.
preset
If you wish you can preset the map to a JavaScript object. This can be useful for adding in metadata or mappings outside the webpack compilation scope.
Note: Any conflicting filepaths in the preset will be overridden during compilation.
stripHash
A function used to strip the hash from the filepath. The default function splits
the filename using the dot (.
) character and rejoins minus the last but one
part, e.g:
function stripHash(filepath) {
var parts = filepath.split('.');
parts.splice(parts.length - 2, 1);
return parts.join('.');
}
stripHash('/site.123123.js')
> '/site.js'
To test the plugin run:
npm test
FAQs
Map the filepaths of files output by a webpack compilation from their hashed version to their unhashed version.
We found that hashed-map-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.