Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
rollup-plugin-svgsprite-generator
Advanced tools
This rollup plugin allows you to generate an external SVG sprite file.
Run the following console command to install the plugin:
npm i rollup-plugin-svgsprite-generator
In the rollup.config.js file, import the plugin and specify the input and output folders:
import { svgSprite } from 'rollup-plugin-svgsprite-generator';
...
export default [
{
...
plugins:[
svgSprite({
input: 'folder-that-contains-the-svg-file',
output: 'path-where-to-generate-the-sprite',
})
]
}
]
You can specify the following generation options:
minify
Type: boolean
| Default value: true
Specifies whether to minify the sprite.
doctype
Type: boolean
| Default value: true
Specifies whether to include the DOCTYPE
header.
xml
Type: boolean
| Default value: true
Specifies whether to include the <xml> tag.
inlineStyles
Type: boolean
| Default value: true
Specifies whether to use inline styles instead of CSS classes in tags.
idConvert
Type: function
| Default value: id => id
Modifies the id
attribute for the <symbol>
tag. Accepts and returns a string value.
styleModification
Type: function
| Default value: id => id
Modifies inline SVG styles. Accepts and returns an object.
output
Type: string
Specifies the file path to the output SVG sprite.
input
Type: string
Specifies the folder that contains input SVG files.
hash
Type: boolean
| Default value: false
Specifies whether to add hash to the output file name.
postGenerate
Type: function
| Default value: (ids, outputFileName) => { }
A callback function executed after the sprite is generated. Accepts IDs of input files and the output file name.
FAQs
Create external svg sprite
We found that rollup-plugin-svgsprite-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.