Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@flarelabs-net/builder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Next.js builder for Cloudflare
Build your app
update the
next.config.mjsas follows/** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", experimental: { serverMinification: false, }, }; export default nextConfig;
add the following
devDependencyto thepackage.json:"node-url": "npm:url@^0.11.4", "wrangler": "^3.77.0"
Execute
npx @flarelabs-net/builder@latestin your app folder
Serve your app
add a
wrangler.tomlat the root of your project#:schema node_modules/wrangler/config-schema.json name = "<app-name>" main = ".worker-next/index.mjs" compatibility_date = "2024-08-29" compatibility_flags = ["nodejs_compat_v2"] workers_dev = true minify = false # Use the new Workers + Assets to host the static frontend files experimental_assets = { directory = ".worker-next/assets", binding = "ASSETS" }Use
wrangler dev