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

Component cache #300

Open
jimafisk opened this issue Nov 23, 2023 · 0 comments
Open

Component cache #300

jimafisk opened this issue Nov 23, 2023 · 0 comments

Comments

@jimafisk
Copy link
Member

It might make sense to add a component cache for generated dom and ssr Svelte components so these do not need to get generate on every build. Loading the compiler into V8 and creating these components is by far the slowest process of the build. This is necessary during development of an app, but once the site is live, the edits through the git-cms are all JSON and media assets.

We should add a command like plenti build --cache=true that will create a directory structure like:

cache
 └─ dom
   └─ layouts/gloabl/html.js
   └─ layouts/gloabl/head.js
   └─ layouts/content/_index.js
 └─ ssr
   └─ layouts/gloabl/html.js
   └─ layouts/gloabl/head.js
   └─ layouts/content/_index.js

Then on future builds if the cache folder exists in the project root, the client build step that compiles the Svelte components will be skipped completely. If you want to regenerate components, just delete the cache folder or plenti build --cache=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant