chore: Move i18n generation, pre-commit hooks (#3410)

This commit is contained in:
Tom Moor
2022-04-17 13:29:08 -07:00
committed by GitHub
parent b10802a0aa
commit 1b913054e8
7 changed files with 297 additions and 60 deletions

View File

@@ -133,9 +133,12 @@ router.get("/locales/:lng.json", async (ctx) => {
await send(ctx, path.join(lng, "translation.json"), {
setHeaders: (res) => {
if (process.env.NODE_ENV === "production") {
res.setHeader("Cache-Control", `max-age=${7 * 24 * 60 * 60}`);
}
res.setHeader(
"Cache-Control",
process.env.NODE_ENV === "production"
? `max-age=${7 * 24 * 60 * 60}`
: "no-cache"
);
},
root: path.join(__dirname, "../../shared/i18n/locales"),
});