Skip to content
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

[IDEA] - incremental ssg #1200

Open
dgrebb opened this issue Jan 28, 2024 · 0 comments
Open

[IDEA] - incremental ssg #1200

dgrebb opened this issue Jan 28, 2024 · 0 comments
Milestone

Comments

@dgrebb
Copy link
Owner

dgrebb commented Jan 28, 2024

this is the way...

sveltejs/kit#2369 (comment)

As mentioned in #2369 (comment), config.kit.prerender.entries (alongside crawl: false) is the solution to this problem. You can put something like this in your svelte.config.js...

// 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

npm run build

to prerender everything, or

npm run build -- /an-article-i-want-to-update /another-article-i-want-to-update

to update /an-article-i-want-to-update and /another-article-i-want-to-update. Or, if you have some programmatic way of determining which URLs have changed, you can put that logic in your config file instead. We could add a new argument to svelte-kit build, but it would only be marginally more convenient than what's already possible in userland, and it wouldn't help in the programmatic case.

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.

@dgrebb dgrebb added this to the 📜 Experience Page milestone Jan 28, 2024
@dgrebb dgrebb self-assigned this Jan 28, 2024
@github-project-automation github-project-automation bot moved this to 🪣 Backlog in dgrebb.com Jan 28, 2024
@dgrebb dgrebb moved this from 🪣 Backlog to 🚜 In Progress in dgrebb.com Jan 28, 2024
@dgrebb dgrebb moved this from 🚜 In Progress to 🚦 Todo in dgrebb.com Jan 28, 2024
@dgrebb dgrebb modified the milestones: ♻ ALM Automation, v5 Apr 27, 2024
@dgrebb dgrebb moved this from 🚦 Todo to 🪣 Backlog in dgrebb.com Apr 27, 2024
@dgrebb dgrebb removed their assignment Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🪣 Backlog
Development

No branches or pull requests

1 participant