New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@svitejs/svelte-preprocess-svg

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svitejs/svelte-preprocess-svg

Optimize inline svg in svelte components

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-55%
Maintainers
2
Weekly downloads
 
Created
Source

@svitejs/svelte-preprocess-svg

Optimize inline svg in svelte components

Installation

npm install --save-dev @svitejs/svelte-preprocess-svg

Usage

svelte.config.js

import { sveltePreprocessSvg } from '@svitejs/svelte-preprocess-svg';
//...
export default {
	//...
	preprocess: [
		//...
		// sveltePreprocessSvg must be used AFTER other markup preprocessors like mdsvex
		sveltePreprocessSvg({
			/* options */
		})
	]
	//...
};

Documentation

options

interface SveltePreprocessSvgOptions {
	/**
	 * Filter function to only include some files
	 *
	 * @param filename
	 * @param content
	 * @return boolean true to include the file
	 */
	// eslint-disable-next-line no-unused-vars
	include?: (filename: string, content?: string) => boolean;

	/**
	 * Filter function to exclude some files
	 *
	 * @param filename
	 * @param content
	 * @return boolean true to exclude the file
	 */
	// eslint-disable-next-line no-unused-vars
	exclude?: (filename: string, content?: string) => boolean;

	/**
	 * Set to true to use a simple string search instead of svelte.parse.
	 * This is faster but not fault tolerant. misaligned html comments or svg inside string literals will trip it up
	 */
	useSimpleStringParser?: boolean;
}

License

MIT

Keywords

FAQs

Package last updated on 02 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc