🎈 Hydrogen. Voted (by me) the world's lightest static-site generator built with TypeScript ❤ It uses 🔥 lit-html inspired templating for super duper performant template generation.
Finally, Hydrogen is at version 1.0.0 with a some cool new features
CACHE_VERSION
constant to the generated Service Worker file, this makes it possible to do cache versioning. Check out docs
#50
dist
folder will automatically be deleted before each build by default, you change the behaviour in the Hydrogen Config fileCheckout the overview article on DEV.to: Dynamically generate routes with HydrogenJS - v0.7.2
Fixed an issue where the templateGenerator
for the generate
command was destructing the data props instead of passing the data as a prop to the page template.
const page = ({ name }) => `
${name}
`;
module.exports = {
page,
data: () => { name: 'John' },
}
const page = ({ data }) => `
${data.name}
`;
module.exports = {
page,
data: () => { name: 'John' },
}
Template API: You no longer have to specify the default
layout in your Page Template, the default layout is automatically used if one is not
const DEV
that gets injected into your custom Service Worker, determines whether you are in dev or prod mode.module.exports = {
head: () => [
['script', { async: true, defer: true, src: 'https://script.js' }, true],
],
}
<script async="true" defer="true" src="https://script.js"></script>
<script async defer src="https://script.js"></script>
Wow! A ton of new features are available 🔥
dist
folder using the extraStaticFiles
property.const routes
array with all the page routes informationUpdated generate
command:
Templates now have access to Head API and Config API when compiling with the generate
command