Closed ak4zh closed 2 years ago
sounds good. i have my own skepticism of adapter-auto, as it means we are constrained to using lowest-common-denominator features of all 3 platforms. but not backed by any research.
@sw-yx I am not sure, but it seems adapter-auto
detects the platform and installs the latest version of the platform specific adapter.
Additionally, if you want to lock the adapter version it seems we can add platform specific adapter alog with the auto.
I haven't tried, but as per the adapter-netlify readme it seems this should be possible.
If you're using adapter-auto, you don't need to install this unless you need to specify Netlify-specific options, since it's already included.
"@sveltejs/adapter-auto": "^1.0.0-next.66",
"@sveltejs/adapter-netlify": "^1.0.0-next.71",
yeah so the question is what exactly are the netlify specific options, and when do we want to use them
for example the edge rendering looks really good. not sure how adapter-auto works with vercel/cloudflare offerings
@sw-yx I think everything you set as adapter options are the platform specific options.
To emable edge in verdel you do following:
import adapter from '@sveltejs/adapter-vercel';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({ edge: true }),
}
};
for netlify it’s:
import adapter from '@sveltejs/adapter-netlify';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({ edge: true }),
}
};
I am not sure if setting the edge
to true
in adapter-auto
enabled for both, if not then may be we need to add a new var PLATFORM
and import the adapter depending on the env var.
Or may be dig deeper into the adapter-auto code to see how it detects the platform and use appropriate adapter.
For now we are not using any platform specific options so it is safe to use adapter-auto
as it deploys on with netlify and vercel.
ok lets see how it goes - is this PR still in draft or is it good to go?
failling build now
this works so sticking with this for now but i have reported the issue in https://github.com/sveltejs/kit/issues/6592
Switched
@sveltejs/adapter-netlify
to@sveltejs/adapter-auto
Will close #74Working deployments: