@svelte-put/preprocess-inline-svg

GitHub Github

svelte preprocessor to inline static svg at build time

@svelte-put/preprocess-inline-svg @svelte-put/preprocess-inline-svg @svelte-put/preprocess-inline-svg @svelte-put/preprocess-inline-svg

Still on Svelte 4? See the old docs site here.


@svelte-put/preprocess-inline-svg is merged into @svelte-put/inline-svg V4 for a more cohesive package.

Migration to @svelte-put/inline-svg

Make sure you have version 4 of @svelte-put/inline-svg installed:

npm install --save-dev @svelte-put/inline-svg
pnpm add -D @svelte-put/inline-svg
yarn add -D @svelte-put/inline-svg

Simply update the import path of the preprocessor in your svelte.config.js:

import inlineSvg from '@svelte-put/preprocess-inline-svg';
import inlineSvg from '@svelte-put/inline-svg/preprocessor';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: [
    inlineSvg(/** truncated config */),
    // other preprocessors
  ],
};
export default config;

Consider switching to the new Vite plugin that wraps the preprocess-inline-svg preprocessor, which provide some improvements to developer experience. See more at @svelte-put/inline-svg.


Happy migrating 😅

Edit this page on Github