This PR add a preprocessor to replace import icons with named export into default export. This processor will only match named import statements using a simple RegEx.
In short, importing icons like this:
<script>
import { Cube, Heart, Horse } from "phosphor-svelte"
</script>
will be replaced into this:
<script>
import Cube from "phosphor-svelte/lib/Cube"
import Heart from "phosphor-svelte/lib/Heart"
import Horse from "phosphor-svelte/lib/Horse"
</script>
Type Import & Alias
The processor also handles type imports (separated) and import alias, for example:
<script>
import { Cube as IconCube, type IconContextProps } from "phosphor-svelte"
</script>
will be replaced into this:
<script>
import IconCube from "phosphor-svelte/lib/Cube";
import type { IconContextProps } from "phosphor-svelte";
</script>
This PR add a preprocessor to replace import icons with named export into default export. This processor will only match named import statements using a simple RegEx.
In short, importing icons like this:
will be replaced into this:
Type Import & Alias
The processor also handles type imports (separated) and import alias, for example:
will be replaced into this: