impact-nova-icons
v0.1.1
Published
Tree-shakable SVG icon library for Impact Nova design system
Readme
Tree-shakable SVG icon library for Impact Nova
Install
npm install impact-nova-iconsUsage
// Barrel import (tree-shakeable)
import { ChevronRight, Pin, Search } from 'impact-nova-icons';
// Per-icon deep import (best tree-shaking)
import { Pin } from 'impact-nova-icons/pin';
// Raw URL for <img src>
import { IAUrl } from 'impact-nova-icons/ia.url';
// Dynamic lookup with allowlist
import { createIconResolver } from 'impact-nova-icons/resolver';
import { Rocket, Store } from 'impact-nova-icons';
const resolveIcon = createIconResolver({ Rocket, Store });
resolveIcon('rocket', { size: 24 });Consumer setup (Vite / React)
No custom Vite plugins or assetsInclude rules are required. The published dist/ is self-contained:
- React icons — pre-compiled
*.svg.jsmodules (SVGR output inlined at build time) - URL exports (
*.url.js) — standardimport.meta.urlreferences to hashed*.svgassets
Use optimizeDeps.exclude: ['impact-nova-icons'] only if you already exclude other asset-heavy ESM libraries (optional).
When developing with file:../impact-nova-icons, add the package root to Vite server.fs.allow (same as any symlinked dependency outside the app root).
sideEffects: falseon the package- Each icon is a separate ES module under
dist/generated/ - Import only the icons you need; unused icons are dropped from your bundle
Development
npm run generate:icons # Regenerate from src/assets/*.svg
npm run build