diff --git a/api/README b/api/README new file mode 100644 index 0000000..1729fcd --- /dev/null +++ b/api/README @@ -0,0 +1,12 @@ +This is a hack to work around a limitation deploying to Vercel! +https://github.com/vercel/vercel/issues/4739#issuecomment-926879578 + +API endpoints declared in here *won't* work during local development, but *will* +work when deployed to production. + +Putting the endpoint here code-splits it separately from the rest of the app +bundle, so its large dependencies aren't grouped in with the others, and thereby +it just barely stays within the dependency bundle size of 50MB. + +If we move off Vercel, it'll be a good idea to move these endpoints back into +the /pages/api folder! diff --git a/pages/api/assetImage.js b/api/assetImage.js similarity index 100% rename from pages/api/assetImage.js rename to api/assetImage.js diff --git a/vercel.json b/vercel.json index cbea1ec..969803f 100644 --- a/vercel.json +++ b/vercel.json @@ -9,7 +9,7 @@ } ], "functions": { - "pages/api/assetImage.js": { + "api/assetImage.js": { "excludeFiles": "node_modules/playwright/**" } }