jorgegorka / svelte-router

Svelte Router adds routing to your Svelte apps. It's designed for Single Page Applications (SPA). Includes localisation, guards and nested layouts.
MIT License
508 stars 42 forks source link

Fix svelte resolve warning in when using Vite and vite-plugin-svelte for compilation #147

Closed CHamalainen closed 9 months ago

CHamalainen commented 9 months ago

Hello

This is my first attempt at OpenSource contribution. This PR aims to fix a warning of deprecation/future build issues, when compiling SvelteJS apps using this package in Vite and with vite-plugin-svelte:

[vite-plugin-svelte] WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future.

svelte-router-spa@6.0.3

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#conflicts-in-svelte-resolve for details.

I've raised this issue a couple of months ago, and wanted to try to fix it myself: https://github.com/jorgegorka/svelte-router/issues/145

Approach:

BE AWARE: I'm unsure of whether this might remove support for other Svelte compilers (non-Vite), since it is necessary to remove the "svelte" key from package.json for the warning to go away. I was unsure of how to test / proceed with this concern. Feedback greatly appreciated.

Thank you for a great router - I hope this contribution is easy to include, else let me know if some action is needed on my part.

jorgegorka commented 9 months ago

Hi @CHamalainen Thank you for your PR I'll take a look at it this week.