diff --git a/.changeset/khaki-phones-jog.md b/.changeset/khaki-phones-jog.md new file mode 100644 index 000000000..fc3905c60 --- /dev/null +++ b/.changeset/khaki-phones-jog.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Fix GitBook specific static assets not being served correctly when deployed on Cloudflare diff --git a/bun.lockb b/bun.lockb index 7da1719ec..2cb95c835 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/gitbook/_routes.json b/packages/gitbook/_routes.json new file mode 100644 index 000000000..8f1cb3e1a --- /dev/null +++ b/packages/gitbook/_routes.json @@ -0,0 +1,4 @@ +{ + "version": 1, + "exclude": ["/~gitbook/static/*"] +} diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json index 0a9dbdd8e..d9f867570 100644 --- a/packages/gitbook/package.json +++ b/packages/gitbook/package.json @@ -68,7 +68,7 @@ "devDependencies": { "@argos-ci/playwright": "^2.0.0", "@playwright/test": "^1.42.1", - "@cloudflare/next-on-pages": "^1.12.1", + "@cloudflare/next-on-pages": "^1.13.3", "@cloudflare/workers-types": "^4.20240725.0", "@types/js-cookie": "^3.0.6", "@types/jsontoxml": "^1.0.5", diff --git a/packages/gitbook/public/_headers b/packages/gitbook/public/_headers new file mode 100644 index 000000000..193088b36 --- /dev/null +++ b/packages/gitbook/public/_headers @@ -0,0 +1,3 @@ +# GitBook immutable static assets +/~gitbook/static/* + cache-control: public,max-age=31536000,immutable