From f45ae204717cd6d54fc6465a218521769b570172 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 2 Nov 2021 01:21:32 -0700 Subject: [PATCH] Fix /api/assetImage for real :p --- api/README | 12 ++++++++++++ {pages/api => api}/assetImage.js | 0 vercel.json | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 api/README rename {pages/api => api}/assetImage.js (100%) 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/**" } }