website: precompress static files instead of relying on fastify compress
- no need to generate the compressed files at runtime - this prevents an issue with fastify compressing pagefind files
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { join } from "path"
|
||||
import Fastify from "fastify"
|
||||
import fsfStatic from "@fastify/static"
|
||||
import fsfCompress from "@fastify/compress"
|
||||
|
||||
const fastify = Fastify({
|
||||
logger: true,
|
||||
})
|
||||
|
||||
fastify.register(fsfCompress)
|
||||
|
||||
fastify.register(fsfStatic, {
|
||||
root: join(import.meta.dirname, process.env.STATIC_DIR || "dist"),
|
||||
preCompressed: true,
|
||||
})
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user