Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

dario-piotrowicz/poc-build-nextjs-app-for-cf-workers

Repository files navigation

    ⚠️     ⚠️     ⚠️

Warning

Repo archived in favour of https://github.com/flarelabs-net/poc-next

    ⚠️     ⚠️     ⚠️

[POC] Build Next.js app for cf workers

This monorepo includes a POC to see if it is possible to get a Next.js application built via next build (in standalone mode) to run in the Cloudflare workerd runtime.

Note

The code here is built based on the amazing work done by @mhart in https://github.com/mhart/nextjs-commerce

The repository

The repository contains two directories:

  • nextjs-worker-builder containing a package that can be used to build Cloudflare workers compatible output from Next.js applications
  • next-apps containing Next.js application that use the above mentioned builder (currently it only contains api-nodejs-hello-world)

How to try out/develop in the repository

Install the dependencies:

pnpm i

build the worker with:

pnpm --filter nextjs-worker-builder build

or in watch mode with:

pnpm --filter nextjs-worker-builder build:watch

build and preview the worker for the api-nodejs-hello-world application:

pnpm --filter api-nodejs-hello-world preview:worker

You can skip building the next app when it has not been modified:

SKIP_NEXT_APP_BUILD=true pnpm --filter api-nodejs-hello-world preview:worker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published