Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
fork-svg-loader
Advanced tools
Webpack loader that inlines SVG content so that you can control and alter it. Unlike SVG inserted as an image, svg-loader allows to animate, change color, control size, etc.
This is a fork of svg-loader to add some features.
npm install fork-svg-loader --save-dev
# or
yarn add --dev fork-svg-loader
// ...
{
test: /\.svg$/,
use: ['svg-loader'] // 👈 Add loader
},
// ...
// with options
{
test: /\.svg$/,
use: [{
loader: 'svg-loader',
options: {
transformAttributes: function (attributes) {
// do your transform
return attributes;
}
}
}] // 👈 Add loader
},
svg-loader exports an object with two properties:
attributes
- the root SVG tag attributes.content
- the SVG content (excluding the root svg
tag).See example output for require('./icon.svg')
:
{
attributes: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 448 512'
},
content: '<path d="M441.9 167.3l-19.8-19.8c-4.7-4.7-12.3-4.7-17 0L224 328.2 42.9 147.5c-4.7-4.7-12.3-4.7-17 0L6.1 167.3c-4.7 4.7-4.7 12.3 0 17l209.4 209.4c4.7 4.7 12.3 4.7 17 0l209.4-209.4c4.7-4.7 4.7-12.3 0-17z"/>'
}
FAQs
Svg loader for webpack
The npm package fork-svg-loader receives a total of 37 weekly downloads. As such, fork-svg-loader popularity was classified as not popular.
We found that fork-svg-loader 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.