Gathering detailed insights and metrics for vite-svg-loader
Gathering detailed insights and metrics for vite-svg-loader
Gathering detailed insights and metrics for vite-svg-loader
Gathering detailed insights and metrics for vite-svg-loader
@gkatsanos/vite-svg-loader
A Vite loader to manage SVG files
vite-plugin-istanbul
vite-plugin-istanbul ========================== [![Codacy grade](https://img.shields.io/codacy/grade/a0c628b128c044269faefc1da74382f7?style=for-the-badge&logo=codacy)](https://www.codacy.com/gh/iFaxity/vite-plugin-istanbul/dashboard) [![npm (scoped)](http
vite-plugin-graphql-loader
A Vite plugin for loading GraphQL files.
file-loader
A file loader module for webpack
npm install vite-svg-loader
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
598 Stars
229 Commits
60 Forks
8 Watching
2 Branches
18 Contributors
Updated on 27 Nov 2024
JavaScript (41.3%)
Vue (22.41%)
CSS (15.54%)
Shell (10.63%)
TypeScript (5.7%)
HTML (4.41%)
Cumulative downloads
Total Downloads
Last day
-0.4%
56,182
Compared to previous day
Last week
-1.3%
288,231
Compared to previous week
Last month
14.1%
1,223,894
Compared to previous month
Last year
105%
10,635,824
Compared to previous year
Vite plugin to load SVG files as Vue components, using SVGO for optimization.
1<template> 2 <MyIcon /> 3</template> 4 5<script setup> 6import MyIcon from './my-icon.svg' 7</script>
1npm install vite-svg-loader --save-dev
vite.config.js
1import svgLoader from 'vite-svg-loader' 2 3export default defineConfig({ 4 plugins: [vue(), svgLoader()] 5})
SVGs can be imported as URLs using the ?url
suffix:
1import iconUrl from './my-icon.svg?url' 2// 'data:image/svg+xml...'
SVGs can be imported as strings using the ?raw
suffix:
1import iconRaw from './my-icon.svg?raw' 2// '<?xml version="1.0"?>...'
SVGs can be explicitly imported as Vue components using the ?component
suffix:
1import IconComponent from './my-icon.svg?component' 2// <IconComponent />
When no explicit params are provided SVGs will be imported as Vue components by default.
This can be changed using the defaultImport
config setting,
such that SVGs without params will be imported as URLs (or raw strings) instead.
vite.config.js
1svgLoader({
2 defaultImport: 'url' // or 'raw'
3})
vite.config.js
1svgLoader({ 2 svgoConfig: { 3 multipass: true 4 } 5})
vite.config.js
1svgLoader({ 2 svgo: false 3})
SVGO can be explicitly disabled for one file by adding the ?skipsvgo
suffix:
1import IconWithoutOptimizer from './my-icon.svg?skipsvgo' 2// <IconWithoutOptimizer />
If you use the loader in a Typescript project, you'll need to reference the type definitions inside vite-env.d.ts
:
1/// <reference types="vite/client" /> 2/// <reference types="vite-svg-loader" />
Thanks to Nexxtmove for sponsoring the development of this project.
Your logo or name here? Sponsor this project.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/5 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
Reason
19 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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