vite-svg-sprite-generator-plugin 1.1.7 → 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.
package/README.md CHANGED
@@ -1,55 +1,38 @@
1
- # 🎨 Vite SVG Sprite Generator
1
+ # 🎨 Vite SVG Sprite Generator Plugin
2
2
 
3
- > Production-ready Vite plugin for automatic SVG sprite generation with HMR support and SVGO optimization
3
+ > Production-ready Vite plugin for automatic SVG sprite generation with HMR, tree-shaking, and SVGO optimization
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).
4
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)
11
+ [![Vite](https://img.shields.io/badge/Vite-4%20%7C%205%20%7C%206%20%7C%207-646CFF?logo=vite)](https://vitejs.dev/)
7
12
 
8
- ## Features
13
+ ## Features
9
14
 
10
- - 🚀 **SVGO Optimization** - Automatic SVG optimization in production builds (40-60% size reduction)
11
- - **Hot Module Replacement** - Instant updates without page reload during development
12
- - 🔒 **Security First** - Built-in XSS protection and path traversal prevention
13
- - 💾 **Smart Caching** - Efficient caching with mtime-based validation
14
- - 🎯 **Auto-Injection** - Sprite is automatically injected into HTML as inline SVG (no separate file)
15
- - 📄 **Inline SVG** - Sprite is inserted directly into the page DOM, no external requests
16
- - 🔧 **Fully Configurable** - Extensive customization options
17
- - 📦 **Zero Config** - Works out of the box with sensible defaults
18
- - 🌳 **Tree-Shakeable** - ES modules with proper exports
19
- - 🎨 **Vite Standard Compliance** - Fully complies with Vite plugin API and ecosystem standards
20
- - 🔄 **Uses Vite Utilities** - Leverages `vite.normalizePath` for consistent cross-platform path handling
15
+ - **2-3x faster builds** - Parallel SVG processing (v1.3.0+)
16
+ - **Tree-shaking** - Remove unused icons (up to 84% reduction)
17
+ - **HMR** - Instant icon updates without page reload
18
+ - **SVGO optimization** - 40-60% smaller sprites
19
+ - **Security** - XSS & path traversal protection
20
+ - **Zero config** - Works out of the box
21
+ - **Framework agnostic** - React, Vue, Svelte, any Vite project
22
+ - **Multi-page support** - Works with [vite-multi-page-html-generator-plugin](https://www.npmjs.com/package/vite-multi-page-html-generator-plugin)
21
23
 
22
- ## 📦 Installation
23
-
24
- ### Basic (without SVGO optimization)
24
+ ## Installation
25
25
 
26
26
  ```bash
27
27
  npm install -D vite-svg-sprite-generator-plugin
28
- ```
29
-
30
- ### Recommended (with SVGO optimization)
31
-
32
- ```bash
33
- npm install -D vite-svg-sprite-generator-plugin svgo
34
- ```
35
28
 
36
- **Note:** SVGO is optional! The plugin works without it, but you'll get 40-60% smaller sprites with SVGO installed.
37
-
38
- <details>
39
- <summary>Other package managers</summary>
40
-
41
- ```bash
42
- # Yarn
43
- yarn add -D vite-svg-sprite-generator-plugin svgo
44
-
45
- # PNPM
46
- pnpm add -D vite-svg-sprite-generator-plugin svgo
29
+ # Optional: SVGO for optimization (recommended)
30
+ npm install -D svgo
47
31
  ```
48
- </details>
49
32
 
50
- ## 🚀 Quick Start
33
+ ## Quick Start
51
34
 
52
- ### 1. Add to Vite Config
35
+ ### 1. Configure Vite
53
36
 
54
37
  ```javascript
55
38
  // vite.config.js
@@ -57,11 +40,7 @@ import { defineConfig } from 'vite';
57
40
  import svgSpritePlugin from 'vite-svg-sprite-generator-plugin';
58
41
 
59
42
  export default defineConfig({
60
- plugins: [
61
- svgSpritePlugin({
62
- iconsFolder: 'src/icons'
63
- })
64
- ]
43
+ plugins: [svgSpritePlugin()]
65
44
  });
66
45
  ```
67
46
 
@@ -72,19 +51,17 @@ src/
72
51
  icons/
73
52
  home.svg
74
53
  user.svg
75
- settings.svg
54
+ search.svg
76
55
  ```
77
56
 
78
- ### 3. Use in HTML
57
+ ### 3. Use Icons
79
58
 
80
59
  ```html
81
60
  <svg class="icon">
82
- <use href="#home"></use>
61
+ <use href="#home" />
83
62
  </svg>
84
63
  ```
85
64
 
86
- ### 4. Use in CSS
87
-
88
65
  ```css
89
66
  .icon {
90
67
  width: 24px;
@@ -93,378 +70,247 @@ src/
93
70
  }
94
71
  ```
95
72
 
96
- That's it! 🎉
97
-
98
- ## 🎨 How It Works
99
-
100
- The plugin automatically **injects the sprite directly into your HTML** as an inline SVG element.
101
-
102
- ✅ **No separate file generated** - Sprite is embedded in the page DOM
103
- ✅ **No external requests** - Everything works in a single HTTP request
104
- ✅ **Automatic injection** - Sprite appears in HTML automatically
105
- ✅ **Fast rendering** - Icons display immediately, no loading delay
106
-
107
- ### Where is the sprite?
108
-
109
- Look for this in your HTML:
110
-
111
- ```html
112
- <svg id="icon-sprite" class="svg-sprite" style="display: none;">
113
- <symbol id="home" viewBox="0 0 24 24">...</symbol>
114
- <symbol id="user" viewBox="0 0 24 24">...</symbol>
115
- </svg>
116
- ```
117
-
118
- The sprite is **injected at the start of your HTML** (just after `<body>` tag).
119
-
120
- ## 🎨 Vite Compliance
121
-
122
- This plugin is built with maximum compliance to Vite standards and best practices:
123
-
124
- - ✅ **Official Vite Plugin API** - Implements all required hooks (`buildStart`, `buildEnd`, `configureServer`, `handleHotUpdate`)
125
- - ✅ **Uses Vite Internal Utilities** - Leverages `vite.normalizePath` for cross-platform path normalization
126
- - ✅ **Vite HMR Integration** - Properly integrates with Vite's HMR system for instant updates
127
- - ✅ **Vite Config Integration** - Respects all Vite configuration options (mode, command, etc.)
128
- - ✅ **Async/Await Standards** - Uses modern async patterns following Vite conventions
129
- - ✅ **TypeScript Support** - Full TypeScript definitions for better DX
130
- - ✅ **No Breaking Changes** - Follows semantic versioning and Vite ecosystem standards
131
- - ✅ **Zero Vite Configuration Override** - Doesn't interfere with other Vite plugins or features
132
-
133
- The plugin seamlessly integrates into your Vite workflow without any conflicts.
134
-
135
- ## 📖 Documentation
136
-
137
- ### Options
73
+ ## Configuration
138
74
 
139
75
  ```typescript
140
76
  interface SvgSpriteOptions {
141
- /** Path to icons folder (default: 'src/icons') */
142
- iconsFolder?: string;
143
-
144
- /** Sprite DOM ID (default: 'icon-sprite') */
145
- spriteId?: string;
146
-
147
- /** Sprite CSS class (default: 'svg-sprite') */
148
- spriteClass?: string;
149
-
150
- /** Symbol ID prefix (default: '' - uses only filename) */
151
- idPrefix?: string;
152
-
153
- /** Enable optimization (default: true) */
154
- optimize?: boolean;
155
-
156
- /** Watch for changes in dev mode (default: true) */
157
- watch?: boolean;
158
-
159
- /** Debounce delay for HMR (default: 100ms) */
160
- debounceDelay?: number;
161
-
162
- /** Verbose logging (default: true in dev, false in prod) */
163
- verbose?: boolean;
164
-
165
- /** Enable SVGO optimization (default: true in production) */
166
- svgoOptimize?: boolean;
167
-
168
- /** Custom SVGO configuration */
169
- svgoConfig?: Config;
77
+ iconsFolder?: string; // Default: 'src/icons'
78
+ spriteId?: string; // Default: 'sprite-id'
79
+ spriteClass?: string; // Default: 'sprite-class'
80
+ idPrefix?: string; // Default: ''
81
+ watch?: boolean; // Default: true (dev)
82
+ debounceDelay?: number; // Default: 100ms
83
+ verbose?: boolean; // Default: true (dev)
84
+ svgoOptimize?: boolean; // Default: true (production)
85
+ svgoConfig?: object; // Custom SVGO config
86
+ currentColor?: boolean; // Default: true
87
+ treeShaking?: boolean; // Default: false
88
+ scanExtensions?: string[]; // Default: ['.html', '.js', '.ts', '.jsx', '.tsx', '.vue', '.svelte']
170
89
  }
171
90
  ```
172
91
 
173
- ### Configuration Examples
174
-
175
- #### Basic Usage
92
+ ### Basic Example
176
93
 
177
94
  ```javascript
178
95
  svgSpritePlugin({
179
96
  iconsFolder: 'src/icons',
97
+ treeShaking: true,
180
98
  verbose: true
181
99
  })
182
100
  ```
183
101
 
184
- #### Custom Configuration
185
-
186
- ```javascript
187
- svgSpritePlugin({
188
- iconsFolder: 'assets/svg',
189
- spriteId: 'my-sprite',
190
- idPrefix: 'icon', // Add prefix: generates 'icon-home', 'icon-user'
191
- debounceDelay: 200,
192
- verbose: true
193
- })
194
- ```
195
-
196
- #### SVGO Optimization
197
-
198
- ```javascript
199
- svgSpritePlugin({
200
- iconsFolder: 'src/icons',
201
- svgoOptimize: true,
202
- svgoConfig: {
203
- multipass: true,
204
- plugins: [
205
- 'preset-default',
206
- {
207
- name: 'removeViewBox',
208
- active: false // Keep viewBox for sprites
209
- },
210
- {
211
- name: 'cleanupNumericValues',
212
- params: {
213
- floatPrecision: 2
214
- }
215
- }
216
- ]
217
- }
218
- })
219
- ```
220
-
221
- #### Aggressive Optimization
102
+ ### Production Optimized
222
103
 
223
104
  ```javascript
224
105
  svgSpritePlugin({
225
106
  iconsFolder: 'src/icons',
226
- svgoOptimize: true,
227
- svgoConfig: {
228
- multipass: true,
229
- plugins: [
230
- 'preset-default',
231
- { name: 'removeViewBox', active: false },
232
- { name: 'cleanupNumericValues', params: { floatPrecision: 1 } },
233
- { name: 'removeAttrs', params: { attrs: '(fill|stroke)' } }
234
- ]
235
- }
107
+ treeShaking: true, // Remove unused icons
108
+ svgoOptimize: true, // Optimize SVG
109
+ currentColor: true // CSS color control
236
110
  })
237
111
  ```
238
112
 
239
- **Result:** Up to 60% size reduction! 🚀
240
-
241
- ## 🔒 Security Features (v1.1.0)
113
+ ## Framework Support
242
114
 
243
- ### Path Traversal Protection
115
+ | Framework | Status | Notes |
116
+ |-----------|--------|-------|
117
+ | **Vite + React** | ✅ Full | [Examples](./VUE_REACT_SVELTE_GUIDE.md#react) |
118
+ | **Vite + Vue 3** | ✅ Full | [Examples](./VUE_REACT_SVELTE_GUIDE.md#vue-3) |
119
+ | **Vite + Svelte** | ✅ Full | [Examples](./VUE_REACT_SVELTE_GUIDE.md#svelte) |
120
+ | **Nuxt 3 (SPA)** | ✅ Full | Set `ssr: false` |
121
+ | **Nuxt 3 (SSR)** | ⚠️ Partial | [SSR Guide](./FRAMEWORK_COMPATIBILITY.md#nuxt-3-ssr) |
122
+ | **SvelteKit** | ⚠️ Partial | SSR limitations |
123
+ | **Next.js** | ❌ No | Uses Webpack, not Vite |
124
+ | **Create React App** | ❌ No | Uses Webpack, not Vite |
244
125
 
245
- The plugin now includes built-in protection against path traversal attacks:
126
+ > **Rule of thumb:** Works with Vite | Doesn't work with Webpack ❌
246
127
 
247
- ```javascript
248
- // ✅ SAFE - Paths inside project root
249
- svgSpritePlugin({ iconsFolder: 'src/icons' })
250
- svgSpritePlugin({ iconsFolder: 'assets/svg' })
251
- svgSpritePlugin({ iconsFolder: './public/icons' })
252
-
253
- // ❌ BLOCKED - Paths outside project root
254
- svgSpritePlugin({ iconsFolder: '../../../etc' }) // Error!
255
- svgSpritePlugin({ iconsFolder: '../../other-project' }) // Error!
256
- svgSpritePlugin({ iconsFolder: '/absolute/path' }) // Error!
257
- ```
128
+ ### React Example
258
129
 
259
- **Error message example:**
130
+ ```jsx
131
+ export function Icon({ name, size = 24 }) {
132
+ return (
133
+ <svg width={size} height={size}>
134
+ <use href={`#${name}`} />
135
+ </svg>
136
+ );
137
+ }
260
138
 
139
+ // Usage
140
+ <Icon name="home" />
261
141
  ```
262
- ❌ Security Error: Invalid iconsFolder path
263
142
 
264
- Provided path: "../../../etc"
265
- Resolved to: "/etc"
266
- Project root: "/home/user/project"
143
+ See [complete framework examples](./VUE_REACT_SVELTE_GUIDE.md).
267
144
 
268
- ⚠️ The path points outside the project root directory.
269
- This is not allowed for security reasons (path traversal prevention).
145
+ ## Key Features
270
146
 
271
- Valid path examples:
272
- - 'src/icons' → relative to project root
273
- - 'assets/svg' → relative to project root
274
- - './public/icons' → explicit relative path
147
+ ### Tree-Shaking
275
148
 
276
- Invalid path examples:
277
- - '../other-project' → outside project (path traversal)
278
- - '../../etc' → system directory access attempt
279
- - '/absolute/path' → absolute paths not allowed
149
+ Remove unused icons from production builds:
280
150
 
281
- 💡 Tip: All paths must be inside your project directory.
151
+ ```javascript
152
+ svgSpritePlugin({
153
+ treeShaking: true // Enable tree-shaking
154
+ })
282
155
  ```
283
156
 
284
- ### XSS Protection
157
+ **How it works:**
158
+ 1. Scans codebase for `<use href="#iconId">`
159
+ 2. Finds used icons in HTML/JS/TS/JSX/TSX/Vue/Svelte
160
+ 3. Removes unused icons from production
161
+ 4. Keeps all icons in dev for better DX
285
162
 
286
- Advanced SVG sanitization with precompiled RegExp patterns:
163
+ **Results:**
164
+ ```
165
+ 50 total icons → 8 used (42 removed, 84% reduction)
166
+ Bundle: 45.2 KB → 7.8 KB
167
+ ```
287
168
 
288
- - Removes `<script>` tags
289
- - Removes event handlers (`onclick`, `onload`, etc.)
290
- - Removes `javascript:` URLs in `href` and `xlink:href`
291
- - Removes `<foreignObject>` elements
169
+ **Per-page optimization:** In multi-page apps, each HTML page gets only its icons.
292
170
 
293
- **Performance:** ~20% faster sanitization compared to v1.0.0
171
+ ### Hot Module Replacement
294
172
 
295
- ---
173
+ Changes to SVG files trigger instant updates without page reload:
296
174
 
297
- ## 🎯 Usage Examples
175
+ ```
176
+ 🔄 SVG files changed, regenerating sprite...
177
+ ✅ HMR: Sprite updated with 10 icons
178
+ ```
298
179
 
299
- ### HTML
180
+ ### Security
300
181
 
301
- ```html
302
- <!-- Basic usage -->
303
- <svg class="icon">
304
- <use href="#home"></use>
305
- </svg>
182
+ Automatic protection against:
183
+ - **XSS attacks** - Removes `<script>`, event handlers, `javascript:` URLs
184
+ - **Path traversal** - Validates icon folder paths
185
+ - **Malicious content** - Sanitizes all SVG before injection
306
186
 
307
- <!-- With custom size -->
308
- <svg class="icon" width="32" height="32">
309
- <use href="#user"></use>
310
- </svg>
187
+ ### Multi-Page Projects
311
188
 
312
- <!-- With aria labels -->
313
- <svg class="icon" role="img" aria-label="Settings">
314
- <use href="#settings"></use>
315
- </svg>
189
+ Works seamlessly with [vite-multi-page-html-generator-plugin](https://www.npmjs.com/package/vite-multi-page-html-generator-plugin):
316
190
 
317
- <!-- With custom prefix (if you set idPrefix: 'icon') -->
318
- <svg class="icon">
319
- <use href="#icon-home"></use>
320
- </svg>
191
+ ```javascript
192
+ export default defineConfig({
193
+ plugins: [
194
+ multiPagePlugin({
195
+ pagesDir: 'src/pages'
196
+ }),
197
+ svgSpritePlugin({
198
+ treeShaking: true // Each page gets only its icons
199
+ })
200
+ ]
201
+ });
321
202
  ```
322
203
 
323
- ### React/Vue/Svelte
324
-
325
- ```jsx
326
- // React
327
- function Icon({ name, className = "icon" }) {
328
- return (
329
- <svg className={className}>
330
- <use href={`#${name}`} />
331
- </svg>
332
- );
333
- }
204
+ ## Performance
334
205
 
335
- // Usage
336
- <Icon name="home" />
206
+ ### Build Time (v1.3.0)
337
207
 
338
- // Or with custom prefix
339
- function Icon({ name, prefix = "", className = "icon" }) {
340
- const id = prefix ? `${prefix}-${name}` : name;
341
- return (
342
- <svg className={className}>
343
- <use href={`#${id}`} />
344
- </svg>
345
- );
346
- }
347
- ```
208
+ | Icons | v1.2.1 | v1.3.0 | Speedup |
209
+ |-------|--------|--------|---------|
210
+ | 50 | 850ms | 420ms | 2.0x |
211
+ | 100 | 1.7s | 810ms | 2.1x ⚡ |
212
+ | 200 | 3.4s | 1.5s | 2.3x ⚡ |
348
213
 
349
- ```vue
350
- <!-- Vue -->
351
- <template>
352
- <svg class="icon">
353
- <use :href="`#${name}`" />
354
- </svg>
355
- </template>
214
+ ### Bundle Size (with tree-shaking)
356
215
 
357
- <script setup>
358
- defineProps(['name']);
359
- </script>
360
216
  ```
217
+ Project: 50 icons total, 8 used
361
218
 
362
- ```svelte
363
- <!-- Svelte -->
364
- <script>
365
- export let name;
366
- </script>
367
-
368
- <svg class="icon">
369
- <use href="#{name}" />
370
- </svg>
219
+ Before: 45.2 KB (all icons)
220
+ After: 7.8 KB (used only)
221
+ Saving: 37.4 KB (83% reduction)
371
222
  ```
372
223
 
373
- ---
374
-
375
- ## 📊 Performance
376
-
377
- ### Optimization Results
378
-
379
- | Metric | Before | After | Improvement |
380
- |--------|--------|-------|-------------|
381
- | Sprite Size | 87 KB | 42 KB | **-52%** |
382
- | Gzip | 24 KB | 14 KB | **-42%** |
383
- | Load Time (3G) | 320 ms | 187 ms | **-42%** |
384
-
385
224
  ### SVGO Optimization
386
225
 
387
226
  ```
388
- clock.svg : 317 → 228 bytes (-28.1%)
389
- layers.svg : 330 → 156 bytes (-52.7%)
390
- sun.svg : 305287 bytes (-5.9%)
227
+ Average reduction: 40-60%
228
+ Example:
229
+ clock.svg: 317228 bytes (-28%)
230
+ layers.svg: 330 → 156 bytes (-53%)
391
231
  ```
392
232
 
393
- **Average reduction: 40-50%** 🎉
394
-
395
- ## 📝 Changelog
233
+ ## How It Works
396
234
 
397
- ### v1.1.7 (2025-01-28)
235
+ The plugin automatically injects the sprite into your HTML:
398
236
 
399
- - 📦 **Version Bump** - Updated for npm publication
400
- - ✅ **No Code Changes** - Identical to v1.1.6
401
- - 🚀 **Ready to Publish** - All versions synchronized
402
-
403
- ### v1.1.6 (2025-01-28)
237
+ ```html
238
+ <body>
239
+ <!-- Injected automatically -->
240
+ <svg id="sprite-id" style="display: none;">
241
+ <symbol id="home" viewBox="0 0 24 24">...</symbol>
242
+ <symbol id="user" viewBox="0 0 24 24">...</symbol>
243
+ </svg>
244
+
245
+ <!-- Your app -->
246
+ <div id="app"></div>
247
+ </body>
248
+ ```
404
249
 
405
- - 🐛 **Fixed Preview Detection** - Preview mode now correctly detected
406
- - 🔍 **Smart Detection** - Detects `serve + production + !SSR = preview`
407
- - **Confirmed Working** - Preview skips validation (0ms)
408
- - 🎯 **Debug Logging** - Shows `command`, `isPreview`, `mode` when verbose
250
+ **Benefits:**
251
+ - No separate file requests
252
+ - Instant rendering
253
+ - Single HTTP request
254
+ - Works with SSR/SSG
409
255
 
410
- ### v1.1.4 (2025-01-21)
256
+ ## Advanced
411
257
 
412
- - **Smart Launch Mode** - Intelligent mode detection for preview command
413
- - 🚀 **Preview Optimization** - Preview runs instantly (0ms vs 583ms)
414
- - 🎯 **Auto-Detection** - Automatic command detection (serve/build/preview)
415
- - ✅ **No Breaking Changes** - Fully backward compatible
258
+ ### Vite Integration
416
259
 
417
- ### v1.1.1 (2025-10-26)
260
+ Uses official Vite APIs:
261
+ - `enforce: 'pre'` - Run before core plugins
262
+ - `apply()` - Conditional execution
263
+ - `createFilter()` - Standard file filtering
264
+ - HMR API - Hot module replacement
418
265
 
419
- - 🔧 **Using `vite.normalizePath`** - Better cross-platform compatibility
420
- - ⚡ Improved Windows/Unix path handling
421
- - 🐛 Better edge case support (network paths, etc.)
422
- - ✅ **No Breaking Changes** - Fully backward compatible
266
+ ### Plugin Hooks
423
267
 
424
- ### v1.1.0 (2025-10-25)
268
+ ```javascript
269
+ {
270
+ configResolved() { // Validate paths
271
+ buildStart() { // Generate sprite
272
+ transformIndexHtml() { // Inject into HTML
273
+ configureServer() { // Setup HMR
274
+ buildEnd() { // Cleanup
275
+ }
276
+ ```
425
277
 
426
- - 🔒 **Path Traversal Protection** - Secure path validation
427
- - ⚡ **100% Async FS** - No event loop blocking
428
- - 🚀 **20% Faster** - Precompiled RegExp patterns
429
- - 📝 **Better Errors** - Detailed messages with examples
430
- - ✅ **No Breaking Changes** - Fully backward compatible
278
+ ### Optimizations
431
279
 
432
- ### v1.0.1 (2025-10-24)
280
+ - Parallel SVG processing
281
+ - mtime-based caching
282
+ - Debounced HMR
283
+ - Tree-shaking
284
+ - SVGO compression
433
285
 
434
- - 📚 **Documentation Updates** - Clarified inline SVG behavior
435
- - 📄 Added "How It Works" section
436
- - 💡 Added "Why Inline SVG?" section explaining benefits
286
+ ## Compatibility
437
287
 
438
- ### v1.0.0 (2025-10-23)
288
+ - **Vite:** 4.x, 5.x, 6.x, 7.x
289
+ - **Node.js:** 14.18.0+
290
+ - **TypeScript:** Full support
291
+ - **OS:** Windows, macOS, Linux
439
292
 
440
- - 🎉 **Initial Release** - Production-ready Vite plugin
441
- - 🚀 SVGO Optimization - 40-60% size reduction
442
- - ⚡ Hot Module Replacement - Instant updates
443
- - 🔒 Security First - XSS protection and path traversal prevention
444
- - 💾 Smart Caching - LRU-like cache with mtime validation
445
- - 🎯 Auto-Injection - Automatic sprite injection into HTML
446
- - 📦 Zero Config - Works out of the box
447
- - 🌳 Tree-Shakeable - ES modules with proper exports
293
+ ## Links
448
294
 
449
- For the complete changelog, see [CHANGELOG.md](CHANGELOG.md)
295
+ - [npm Package](https://www.npmjs.com/package/vite-svg-sprite-generator-plugin)
296
+ - [GitHub Repository](https://github.com/gkarev/vite-svg-sprite-generator-plugin)
297
+ - [Issues](https://github.com/gkarev/vite-svg-sprite-generator-plugin/issues)
298
+ - [Changelog](./CHANGELOG.md)
450
299
 
451
- ## 📄 License
300
+ ## Documentation
452
301
 
453
- MIT © Karev G.S.
302
+ - [Framework Examples (React/Vue/Svelte)](./VUE_REACT_SVELTE_GUIDE.md)
303
+ - [Framework Compatibility (Next.js/Nuxt/etc)](./FRAMEWORK_COMPATIBILITY.md)
304
+ - [Tree-Shaking Guide](./TREE_SHAKING_GUIDE.md)
454
305
 
455
- ## 🙏 Acknowledgments
306
+ ## Related Plugins
456
307
 
457
- - [SVGO](https://github.com/svg/svgo) - SVG optimization
458
- - [Vite](https://vitejs.dev/) - Build tool
308
+ - [vite-multi-page-html-generator-plugin](https://www.npmjs.com/package/vite-multi-page-html-generator-plugin) - Multi-page static site generator
459
309
 
460
- ## 📧 Support
310
+ ## License
461
311
 
462
- - 🐛 [Issues](https://github.com/gkarev/vite-svg-sprite-generator-plugin/issues)
463
- - 💬 [Discussions](https://github.com/gkarev/vite-svg-sprite-generator-plugin/discussions)
312
+ MIT © [Karev G.S.](https://github.com/gkarev)
464
313
 
465
314
  ---
466
315
 
467
- Made with ❤️ by Karev G.S.
468
-
469
- If this plugin helped you, please ⭐ star the repo!
470
-
316
+ **Made with ❤️ for the Vite ecosystem**