npm.io
0.1.4 • Published 4 years ago

@sapper-dragon/svgo

Licence
MIT
Version
0.1.4
Deps
2
Size
6 kB
Vulns
0
Weekly
0
Stars
2

@sapper-dragon/svgo

Decorate your Sapper project with SVGO.

@sapper-dragon/svgo utilizes SVGO under the surface, which is a tool for optimizing Scalable Vector Graphics files.

Installation

npm install @sapper-dragon/svgo --save-dev
# or
yarn add @sapper-dragon/svgo --dev

Usage

This project requires the @sapper-dragon/trimmings lib, so look there first for instructions, then come back.

@sapper-dragon/svgo converts files from an SVGO folder and outputs them to optimized and importable *.svelte files and static *.svg files.

Config

You can place a trimmings.config.js file in the root of your project to set configutations. These are the defaults:

export default {
	svgo: {
		input: 'src/trimmings/svgo', // path to watch *.svg files
		filter: /\.(svg)$/, // pattern for files to watch
		outputSvelte: 'src/routes/_svg', // svelte output path
		outputStatic: 'static/svg', // static output path
	},
	// ... additional settings from other @sapper-dragon packages...
}

If outputSvelte or outputStatic are set to false, files will not be saved to those paths.

Keywords