pixelmund / svemix

The Full-Stack addition to SvelteKit. Write your server code inside svelte files, handle sessions, forms and SEO easily.
https://svemix.com
MIT License
336 stars 16 forks source link

Respect SvelteKit Config for `kit.files.routes` #27

Closed Acmion closed 2 years ago

Acmion commented 2 years ago

The route directory can be changed with SvelteKit like this:

const config = 
{
    kit: 
    {
        files: 
        {
            routes: "src/web" // or whatever
        }
    }
}

However, this configuration will essentially disable Svemix, because the route directory is hardcoded as src/routes.

This can be fixed by amending the config like this:

const config = 
{
    svemix: 
    {
        routes: "src/web"
    },
    kit: 
    {
        files: 
        {
            routes: "src/web" // or whatever
        }
    }
}

However, the fix is not documented, nor is the property routes a part of Svemix_Config_Object. Although, the property routes is a part of the defaultConfig, which is why the problem can be fixed.

Still, the most sensible way to go about this would be just to respect the configuration of kit.files.routes.

pixelmund commented 2 years ago

Hey, that seems fairly reasonable to me. I think i can get the required changes in very quickly, since we're already loading the config this should be pretty straight forward.