codefeathers / rollup-plugin-svelte-svg

Import SVG files as Svelte Components
MIT License
75 stars 13 forks source link

macOS is wrongly identified as Windows #2

Closed 5amch3n closed 4 years ago

5amch3n commented 4 years ago
// rollup-plugin-svelte-svg.cjs.js line #10 (src/index.js line #7)
const isWindows = os.platform().includes("win");

On macOS, os.platform() returns 'darwin', which includes 'win'. When macOS is wrongly identified as Windows, an error occurs, something like "[!] (plugin svg) Error: options.name must be a valid identifier (got '/Users/samch3n/my-project/static/svgs/solid/book')"

MKRhere commented 4 years ago

Good find, thanks. I'll fix this in the next release.

MKRhere commented 4 years ago

Fixed in ddd54aa3b46bc08843473c08150d09b77ad7df30 v0.2.1: npm