vite-svg-sprite-generator-plugin 1.3.0 → 1.3.1

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 +4 -0
  2. package/package.json +10 -4
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  > Production-ready Vite plugin for automatic SVG sprite generation with HMR, tree-shaking, and SVGO optimization
4
4
 
5
+ **The Problem:** Using separate SVG files creates multiple HTTP requests. Inline SVG in HTML duplicates code and bloats your markup. Creating and maintaining SVG sprites manually is tedious and error-prone.
6
+
7
+ **The Solution:** This plugin automatically generates an optimized SVG sprite from your icons folder and injects it directly into HTML. Works in **dev mode with HMR** — edit an icon → see changes instantly without page reload. Tree-shaking removes unused icons in production (up to 84% reduction).
8
+
5
9
  [![npm version](https://img.shields.io/npm/v/vite-svg-sprite-generator-plugin.svg)](https://www.npmjs.com/package/vite-svg-sprite-generator-plugin)
6
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
11
  [![Vite](https://img.shields.io/badge/Vite-4%20%7C%205%20%7C%206%20%7C%207-646CFF?logo=vite)](https://vitejs.dev/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-svg-sprite-generator-plugin",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Production-ready Vite plugin for automatic SVG sprite generation with HMR support, SVGO optimization, security features, and tree-shaking",
5
5
  "main": "vite-svg-sprite-generator-plugin.js",
6
6
  "module": "vite-svg-sprite-generator-plugin.js",
@@ -20,8 +20,10 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "scripts": {
23
- "prepublishOnly": "npm test",
24
- "test": "echo \"Tests passed\""
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage",
26
+ "prepublishOnly": "npm test"
25
27
  },
26
28
  "keywords": [
27
29
  "vite",
@@ -67,7 +69,11 @@
67
69
  "optionalDependencies": {
68
70
  "svgo": "^3.0.0 || ^4.0.0"
69
71
  },
70
- "devDependencies": {},
72
+ "devDependencies": {
73
+ "@types/node": "^20.0.0 || ^22.0.0",
74
+ "vite": "^5.0.0 || ^6.0.0",
75
+ "vitest": "^2.0.0"
76
+ },
71
77
  "engines": {
72
78
  "node": ">=14.18.0"
73
79
  }