bun run ./src/main.ts worked first try so I couldn't resist.
can't be merged until bun install --production filters dev deps properly.
as-is, this works if you install node in the image and use that to run the next standalone build output. but doing that is cringe.
issues
stream/promises is missing types but bun seems to support it...?
docker builds are currently huge maybe probably because of https://github.com/oven-sh/bun/issues/8033 but if thats our images might just barely beat the base nodejs alpine image in size 👉👈
minifying the api build output shaves off a few more mb, but error messages then include a snippet of code that is many thousands of characters long
bun is missing TextDecoderStream or something which is necessary for next middleware because next uses a special runtime even for standalone builds because of course and no theres no way to switch to nodejs as a runtime. but only for middleware, because of course.
replacing nextjs with vite+vite-plugin-ssr would be fun
the only other alternative is replacing the middleware with something else, which seems somehow worse
sharp is listed as a dependency which means it ends up unbundled in the final docker image. it might be possible to make it a devDependency and bundle it?
bun run ./src/main.ts
worked first try so I couldn't resist. can't be merged untilbun install --production
filters dev deps properly. as-is, this works if you installnode
in the image and use that to run the next standalone build output. but doing that is cringe.issues
stream/promises
is missing types but bun seems to support it...?TextDecoderStream
or something which is necessary for next middleware because next uses a special runtime even for standalone builds because of course and no theres no way to switch to nodejs as a runtime. but only for middleware, because of course.sharp
is listed as a dependency which means it ends up unbundled in the final docker image. it might be possible to make it a devDependency and bundle it?