Skip to content

Commit

Permalink
meta: update readme and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyynthia committed Jul 14, 2024
1 parent 80b074f commit 16b303b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 22 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Magical SVG 🪄
[![GitHub Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-support%20me-EA4AAA?style=flat-square)](https://github.com/sponsors/cyyynthia)
[![License](https://img.shields.io/github/license/cyyynthia/vite-plugin-magical-svg.svg?style=flat-square)](https://github.com/cyyynthia/vite-plugin-magical-svg/blob/mistress/LICENSE)
[![npm](https://img.shields.io/npm/v/vite-plugin-magical-svg?style=flat-square)](https://npm.im/vite-plugin-magical-svg)

An all-in-one [Vite](https://vitejs.dev/) plugin that magically makes working with SVGs and bundling them a breeze.

Can mostly be used as a [drop-in replacement of SVGR](#migrating-from-svgr) and similar tools.

## Backstory
Inspired by a [tweet](https://twitter.com/_developit/status/1382838799420514317) from Preact's creator Jason Miller,
I've been looking at plugins that would let me work with SVGs, as I myself did the error of embedding SVGs as React
Expand Down Expand Up @@ -95,3 +98,11 @@ import fileUrl from './assets/icon.svg?file' // Works like .png and other file i
### `exports` note
This plugin **does not** respect the `exports` field when importing svg files from third-party packages such as
`simple-icons`, which do not expose them.

### Migrating from SVGR
This plugin can mostly be used as a drop-in replacement of SVGR; unless you're dealing with complex SVGs or need to
style/animate individual parts of the SVG, the code generated by this plugin should behave just as you're used to,
plus the [preprocessing of your SVGs](#svg-processing).

Make sure to enable `preserveWidthHeight` for best compatibility. This option is not enabled by default as it was not
done historically by the plugin, and suddenly doing it would be a breaking change.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "vite-plugin-magical-svg",
"license": "BSD-3-Clause",
"version": "1.3.0",
"description": "An all-in-one Vite plugin that magically makes working with SVGs and bundling them a breeze",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/cyyynthia/vite-plugin-magical-svg.git"
},
"author": "Cynthia <[email protected]>",
"license": "BSD-3-Clause",
"author": "Cynthia <[email protected]> (https://cynthia.dev)",
"repository": "github:cyyynthia/vite-plugin-magical-svg",
"bugs": "https://github.com/cyyynthia/vite-plugin-magical-svg/issues",
"funding": "https://github.com/sponsors/cyyynthia",
"keywords": [
"vite-plugin",
"svg"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"packageManager": "[email protected]",
"scripts": {
"prepack": "tsc",
"build": "tsc"
Expand All @@ -24,7 +24,7 @@
"xml2js": "^0.6.2"
},
"devDependencies": {
"@types/node": "^20.14.9",
"@types/node": "^20.14.10",
"@types/xml2js": "^0.4.14",
"rollup": "^2.79.1",
"typescript": "^5.5.3",
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16b303b

Please sign in to comment.