Gathering detailed insights and metrics for vue-cli-plugin-svg-sprite
Gathering detailed insights and metrics for vue-cli-plugin-svg-sprite
npm install vue-cli-plugin-svg-sprite
Typescript
Module System
Node Version
NPM Version
63.6
Supply Chain
81.3
Quality
71
Maintenance
50
Vulnerability
87.6
License
JavaScript (75.62%)
Vue (24.38%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
875,634
Last Day
570
Last Week
2,891
Last Month
12,180
Last Year
149,933
MIT License
68 Stars
33 Commits
10 Forks
5 Watchers
1 Branches
9 Contributors
Updated on Sep 16, 2024
Minified
Minified + Gzipped
Latest Version
1.1.0
Package Id
vue-cli-plugin-svg-sprite@1.1.0
Unpacked Size
14.91 kB
Size
6.40 kB
File Count
11
NPM Version
6.4.1
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last Day
-4%
570
Compared to previous day
Last Week
1.4%
2,891
Compared to previous week
Last Month
85.6%
12,180
Compared to previous month
Last Year
-3.1%
149,933
Compared to previous year
1
vue-cli 3 plugin to build an SVG sprite using svg-sprite-loader.
1vue add svg-sprite
Use the SvgIcon component provided by the generator or check the loader documentation for other/advanced usages.
N.B. This plugin only adds a loader to the Webpack configuration, it doesn't glob your directory and include every file it finds. You need to require the icons from within your code (JS, CSS, etc.) just like other modules to have them added to the sprite!
Most options for this plugin are passed directly to svg-sprite-loader and its plugin.
Please refer to their documentation for further details.
The configuration must be defined in your vue.config.js
file as below (defaults shown).
1module.exports = { 2 pluginOptions: { 3 svgSprite: { 4 /* 5 * The directory containing your SVG files. 6 */ 7 dir: 'src/assets/icons', 8 /* 9 * The reqex that will be used for the Webpack rule. 10 */ 11 test: /\.(svg)(\?.*)?$/, 12 /* 13 * @see https://github.com/kisenka/svg-sprite-loader#configuration 14 */ 15 loaderOptions: { 16 extract: true, 17 spriteFilename: 'img/icons.[hash:8].svg' // or 'img/icons.svg' if filenameHashing == false 18 }, 19 /* 20 * @see https://github.com/kisenka/svg-sprite-loader#configuration 21 */ 22 pluginOptions: { 23 plainSprite: true 24 } 25 } 26 } 27};
It is possible to add extra Webpack loaders to this plugin. This can be useful if you want your icons to be optimized before the sprite is created. The following example can be created using the generator and uses svgo and svgo-loader to accomplish this.
Install extra dependencies:
1npm install svgo svgo-loader --save-dev
Add the loader to your Webpack config in your vue.config.js
file:
1module.exports = { 2 chainWebpack: config => { 3 config.module 4 .rule('svg-sprite') 5 .use('svgo-loader') 6 .loader('svgo-loader'); 7 } 8};
config.module.rule('svg-sprite')
config.module.rule('svg-sprite').use('svg-sprite-loader')
config.plugin('svg-sprite')
Please see CHANGELOG for more information about what has changed recently.
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
This package is a vue-cli 3 plugin wrapping svg-sprite-loader. Many thanks to Stas Kurilov for his excellent package!
The MIT License (MIT). Please see License File for more information.
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More