vite-plugin-svgr 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +16 -1
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  Vite plugin to transform SVGs into React components. Uses [svgr](https://github.com/gregberge/svgr) under the hood.
6
6
 
7
7
  ## Installation
8
+
8
9
  ```sh
9
10
  # npm
10
11
  npm install --save-dev vite-plugin-svgr
@@ -54,7 +55,7 @@ svgr({
54
55
  // ...
55
56
  },
56
57
 
57
- // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include. By default all svg files will be included.
58
+ // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include.
58
59
  include: "**/*.svg?react",
59
60
 
60
61
  // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should ignore. By default no files are ignored.
@@ -62,6 +63,20 @@ svgr({
62
63
  });
63
64
  ```
64
65
 
66
+ If you want to enable SVGO you can install `@svgr/plugin-svgo` and use following options to enable and configure it:
67
+
68
+ ```js
69
+ svgr({
70
+ svgrOptions: {
71
+ plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
72
+ svgoConfig: {
73
+ floatPrecision: 2,
74
+ },
75
+ },
76
+ // ...
77
+ });
78
+ ```
79
+
65
80
  ## License
66
81
 
67
82
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-svgr",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Vite plugin to transform SVGs into React components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -32,14 +32,14 @@
32
32
  "author": "Rongjian Zhang",
33
33
  "license": "MIT",
34
34
  "devDependencies": {
35
- "@types/node": "^20.7.2",
35
+ "@types/node": "^20.9.1",
36
36
  "typescript": "^5.2.2"
37
37
  },
38
38
  "peerDependencies": {
39
- "vite": "^2.6.0 || 3 || 4"
39
+ "vite": "^2.6.0 || 3 || 4 || 5"
40
40
  },
41
41
  "dependencies": {
42
- "@rollup/pluginutils": "^5.0.4",
42
+ "@rollup/pluginutils": "^5.0.5",
43
43
  "@svgr/core": "^8.1.0",
44
44
  "@svgr/plugin-jsx": "^8.1.0"
45
45
  },