shalomscott / eleventy-plugin-embed-svelte

An Eleventy plugin that makes embedding Svelte components in your static pages painfully easy.
https://shalomscott.github.io/eleventy-plugin-embed-svelte/
MIT License
40 stars 4 forks source link

Malformed fileName when compiling on Windows #12

Open daemuth opened 2 years ago

daemuth commented 2 years ago

Issue description When compiling the plugin / example on Windows the user is presented with an error saying "Malformed fileName". The issue seems to be caused by the regex pattern /.*\/(.*)\./ expecting a forward slash (/) instead of a backslash (\).

Steps to reproduce

  1. Clone the repository in a Windows environment
  2. Run npm install in the cloned repository
  3. Build the plugin using the provided script (npm run build)
  4. Enter the example directory
  5. Run npm install
  6. Run npm run start
  7. Observe error

Workaround This issue can be bypassed by using the following regex pattern: /.*\\(.*)\./). Please note, however, that this introduces the reverse of the issue noted above, and as such a proper multi-platform solution should be introduced.