platformicons icon indicating copy to clipboard operation
platformicons copied to clipboard

Compile SVGs as React Components in Dist

Open dcramer opened this issue 11 months ago • 0 comments

Right now you cannot use this package out of the box in a common place React app (e.g. Vite), due to the way SVGs are bundled.

We should make the distribution package simple build and ship actual components, rather than requiring a specialized loader that understands svg etc.

Current error:

✘ [ERROR] No loader is configured for ".svg" files: ../../node_modules/.pnpm/[email protected][email protected]/node_modules/platformicons/svg_80x80/tauri.svg

    ../../node_modules/.pnpm/[email protected][email protected]/node_modules/platformicons/esmbuild/preload.js:10:74:
      10 │ ...map((icon) => require(`../${f === "lg" ? "svg_80x80" : "svg"}/${icon}.svg`)))
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

dcramer avatar Jan 23 '25 18:01 dcramer