hydrogenjs / hydrogen

🎈 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.
https://hydrogen-js.netlify.app/
MIT License
167 stars 9 forks source link

Build hooks #54

Open shailen-naidoo opened 4 years ago

shailen-naidoo commented 4 years ago

The goal of Hydrogen is to be as flexible as possible to all users, I figured the best way to make it even more flexible is to add build hooks which would allow users to do just about anything they can think:

Here are a list of Hooks that I want to expose via a file called hydrogen.hooks.js

exports.beforeDistRemoved = async (ctx) => {
};

exports.afterDistRemoved = async (ctx) => {
};

exports.beforeBuild = async (ctx) => {
};

exports.afterBuild = async (ctx) => {
};

exports.beforeEachPage = async (ctx) => {
};

exports.afterEachPage = async (ctx) => {
};

exports.beforeServiceWorkerGenerated = async (ctx) => {
};

exports.afterServiceWorkerGenerated = async (ctx) => {
};