8000 Compile SVGs as React Components in Dist · Issue #191 · getsentry/platformicons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Compile SVGs as React Components in Dist #191
Open
@dcramer

Description

@dcramer

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/platformicons@7.0.4_react@18.3.1/node_modules/platformicons/svg_80x80/tauri.svg

    ../../node_modules/.pnpm/platformicons@7.0.4_react@18.3.1/node_modules/platformicons/esmbuild/preload.js:10:74:
      10 │ ...map((icon) => require(`../${f === "lg" ? "svg_80x80" : "svg"}/${icon}.svg`)))
         ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0