Skip to content

Releases: damianstasik/vite-svg

v0.7.0

24 Aug 21:17
Compare
Choose a tag to compare

A small fix for an error during build caused by some internal changes in Vite, now vite-plugin-svg should work fine with the latest Vite version (1.0.0-rc.4).

Thank you @RegisFrey for reporting the issue!

v0.6.0

17 Jul 08:18
Compare
Choose a tag to compare

This release fixes the error when trying to import an SVG file from node_modules or some aliased path.

v0.5.0

23 Jun 07:55
Compare
Choose a tag to compare

Nothing new unfortunately, just a compatibility update to use the new transform API signature (instead of multiple variables, a single object is now provided).

Vite is now at 1.0.0-beta!!

v0.4.0

14 Jun 19:05
Compare
Choose a tag to compare

Important note

This is a release with a breaking change, please read the notes below to understand how to migrate from vite-plugin-svg@0.3.0+.

New way of importing SVGs as Vue components

Before v0.4.0 you would add ?component query string at the end of the file path to import an SVG file. This caused a few issues with Rollup and Jest, as they do not support (yet?) query strings in the file paths. Starting from v0.4.0 you will have access to both SVG file URL and Vue component using a single import statement:

import myIconUrl, { VueComponent as MyIcon } from './svgs/icon.svg';

console.log(myIconUrl); // `/src/svgs/icon.svg`
console.log(MyIcon); // SVG as Vue component

In the example above you can see that there are two things exported by ./svgs/icon.svg:

  1. Default export which returns URL to the file (handled by Vite)
  2. Named export called VueComponent which returns the SVG file converted to a Vue component (handled by vite-plugin-svg)

Due credit: VueComponent name is inspired by @svgr/webpack (which uses ReactComponent).

Installing @vue/compiler-dom is no longer needed

vite-plugin-svg will now use @vue/compiler-sfc which you should already have installed as a devDependency in pair with vite.

v0.3.0

05 Jun 18:52
Compare
Choose a tag to compare

It's been a while! A lot has changed in Vite since vite-plugin-svg@0.2.0, most notably we now have a plugin system and ability to add custom transforms!

v0.2.0

08 May 22:42
Compare
Choose a tag to compare

Support Vite v0.13.0 which required a tiny modification to the Koa middleware (getDevSvgPlugin) as there was a slight change of the way static assets are handled, fortunately nothing that would break this plugin for good 💪

v0.1.1

08 May 15:48
Compare
Choose a tag to compare

First release that supports Vite v0.12.0