-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental builds support for static adapter #2369
Comments
That would be a game changer for big websites, currently I have to wait around 15 minutes to ship a simple fix. |
We have currently the same use case:
Try of a solution propsoal:
Some open questions from my side:
What do you think :)? Maybe @benmccann and @Rich-Harris you have some thoughts about this? |
Just out of curiosity, couldn't you just build some pages by specifying Maybe my insight in the topic is too shallow, so please correct me if i am wrong. |
This would be awesome to have this feature. If I understood correctly, Nextjs has similar feature getStaticPaths: https://nextjs.org/docs/basic-features/data-fetching/get-static-paths |
As mentioned in #2369 (comment), // svelte.config.js
import adapter from '@sveltejs/adapter-static';
export default {
kit: {
prerender: {
entries: process.argv.length > 3 ? process.argv.slice(3) : ['*'],
crawl: process.argv.length <= 3
}
}
}; ...then do
to prerender everything, or
to update Of course, if you're using a hosted CI service then you need to be able to access the previously built pages somehow — there's nothing SvelteKit can do to help with that. A better solution to all this would be to have some form of incremental static regeneration (#661), but that's a post-1.0 TODO. |
I think Next.js' getStaticPaths solves a major issue of not having to centrally manage the paths to be rendered (during ISR too if configured right?). My use case is 20000+ pages spread out across different categories (types) of pages. |
The previously built pages are available on your published site, I think this one can easily be solved if you add a sitemap.xml to your deployment. // svelte.config.js
import adapter from '@sveltejs/adapter-static';
async function readSiteMap() {
/* fetch the sitemap and parse the routes out from it */
}
const entries = await readSiteMap();
export default {
kit: {
prerender: {
entries: entries.length ? entries : ['*'],
crawl: entries.length == 0
}
}
}; This doesn't even have to be a sitemap, you could create an endpoint or any other method to provide this information from the already deployed website. |
I tried the suggestions from @stephane-vanraes and @Rich-Harris above and both failed for different reasons: import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
async function readSiteMap() {
/* fetch the sitemap and parse the routes out from it */
return ['/','/collections/tags_cats']
}
const entries = await readSiteMap();
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
fallback: null,
precompress: false,
strict: false
}),
prerender: {
concurrency: 10,
handleHttpError: 'ignore',
handleMissingId: 'ignore',
entries: entries.length ? entries : ['*'],
crawl: entries.length === 0
}
}
};
export default config; Failed with this message:
I can make it work if I disable prerender on those pages, but that's not really what I want here. Ideally I'd just be able to render a single dynamic blog page, or all blog pages, and no do everything else. Right now my website as millions of pages all statically generated, which takes about an hour. Ideally I'd only regenerate things that are changing. Like when I add a new blog post, or a new link or a new photo I'd just update the relevant pages. I'm happy to keep track of what those are, I just don't see a way to do a partial crawl etc. Here's my site if you'd like to take a look: https://eecue.com ... basically I'v posted my entire photo achieve from 25+ years of shooting. |
Also having exactly the same problem 😢 |
Describe the problem
Having to rebuild the static pages from scratch after minor change which takes lot of time if there lots of pages.
Describe the proposed solution
Only build the changed pages.
Alternatives considered
No response
Importance
would make my life easier
Additional Information
Gatsby v3 have incremental builds.
The text was updated successfully, but these errors were encountered: