Decorate your Sapper project with SVGO.
@sapper-dragon/svgo
utilizes SVGO under the surface, which is a tool for optimizing Scalable Vector Graphics files.
npm install @sapper-dragon/svgo --save-dev
# or
yarn add @sapper-dragon/svgo --dev
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.
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.