-
Notifications
You must be signed in to change notification settings - Fork 66
Description
As a first approach, the static files are just copied over to .hlx/dist. while this works for local development, it does not work for production. eventually the static files need to be served to the CDN.
similar to the approach in https://github.com/adobe/project-helix/pull/266, the static files could be made available via wsk action. however, I don't think that the wsk-action should load it again from git, because the codeload usually provides too much content.
The static resources could be bundled in the wsk action that delivers them. either in a generic static-server action contains all the resources needed to the project, or alongside the respective html.js action.
Alternatively, a gh-pages approach would be better instead of abusing wsk as a static file server. For each deployment, the static files are committed into a helix-static branch, and the ref of the current state is used in the strains.yaml to configure the static server.
how it works
having a separate static-server action is better, as the fundamental idea of just delivering static assets is easily applied to other mediums (S3, etc.)
- the parcel-plugin-htl is enhanced so that it also processes the sub-assets referenced in the htl code Optionally process sub-assets during htl parsing parcel-plugin-htl#16
- the plugin generates the
.hlx/build/html.jsand also the.hlx/dist/*variants of the referenced assets. - the
hlx deploydeploys not only thehtml.jsaction, but also astatic-serveraction that provides a simple server for the static files or commits the static files intohelix-static.