Skip to content

Instantly share code, notes, and snippets.

@Bumboobee
Last active July 13, 2023 10:48
Show Gist options
  • Save Bumboobee/892cbaacde17b4502c540a2536acdd5d to your computer and use it in GitHub Desktop.
Save Bumboobee/892cbaacde17b4502c540a2536acdd5d to your computer and use it in GitHub Desktop.
Enable svg images on vite application ๐Ÿ‘พ
//install the plugin dependencies
npm i vite-plugin-svgr
//on vite.config.js, add the import and the plugin reference
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(), react()],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment