Isaac McFadyen | YYZ01
02/23/2022, 7:52 PMmibaatwork
02/23/2022, 7:53 PMIsaac McFadyen | YYZ01
02/23/2022, 7:54 PMIsaac McFadyen | YYZ01
02/23/2022, 7:54 PMmibaatwork
02/23/2022, 7:56 PMvivekpatt_whyd
02/23/2022, 8:08 PMwebsite/sitemap.xml
(probably this one)
or
website/en/sitemap.xml
So how should i structure the functions folder ?
Since you said it shouldn't be in dist, do you mean that i should be at project's root and I just have to git push it and pages will take care of the functions ?Isaac McFadyen | YYZ01
02/23/2022, 8:09 PM.js
, so with your sitemap example it would be sitemap.xml.js
and then Pages will strip the JS off and allow you to access it at sitemap.xml
.Isaac McFadyen | YYZ01
02/23/2022, 8:10 PM/functions/test/sitemap.xml.js
would be at example.com/test/sitemap.xml
,
/functions/test2/hi.js
would be at example.com/test2/hi
,
etc.vivekpatt_whyd
02/23/2022, 8:13 PMIsaac McFadyen | YYZ01
02/23/2022, 8:13 PMLarry
02/24/2022, 4:14 AMadapter-static
for the UI and Cloudflare's /functions for my API. I didn't try this but thought about it.
3. Drop back to plain old Svelte (not SvelteKit) for just the UI and use Cloudflare for everything else. I gave up a few things going this way:
a) SveltKit's filesystem router but I am using svelte-spa-router on another project that started pre-SvelteKit so I'm already comfortable with that approach.
b) SSR. I consider SSR an unnecessary complexity for what I'm doing. I'm not building a content app where search engine optimization is critical and the data round trip time is a bigger determinant of the user experience than the UI render time for my context. I think you give this up with alternative 2 also.
c) SvelteKit's elegant hierarchical _layout approach. In that other project I had already built a poor man's equivalent to _layout using the <svelte:component this={$activeComponent} />
tag so I'm not losing much.
d) The ability to deploy to someplace other than Cloudflare. Alternative 2 also gives this up. I'm building with durable objects so I need Cloudflare no matter what so this was no loss for me, but could be for you.
Of course, you may have a different context and decide to go a different route but wanted to share what I learned in the hopes it could help you.vivekpatt_whyd
02/24/2022, 11:31 AMmibaatwork
02/24/2022, 5:40 PMIsaac McFadyen | YYZ01
02/24/2022, 5:44 PMmibaatwork
02/24/2022, 6:08 PMIsaac McFadyen | YYZ01
02/24/2022, 6:58 PMmibaatwork
02/24/2022, 7:01 PMIsaac McFadyen | YYZ01
02/24/2022, 7:01 PMmibaatwork
02/24/2022, 7:03 PMIsaac McFadyen | YYZ01
02/24/2022, 7:04 PMmibaatwork
02/24/2022, 7:05 PMIsaac McFadyen | YYZ01
02/24/2022, 7:06 PMIsaac McFadyen | YYZ01
02/24/2022, 7:06 PMmibaatwork
02/24/2022, 7:14 PMSkye
02/24/2022, 7:19 PMLostballoon
02/24/2022, 9:50 PMThe package "path" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
Isaac McFadyen | YYZ01
02/24/2022, 9:53 PMLostballoon
02/24/2022, 9:56 PMLostballoon
02/25/2022, 10:00 PMLostballoon
02/25/2022, 10:01 PM