buncid/rebuilds/next-js
Benjamin Toby 619afc8303 Updates
2025-02-03 13:41:13 +01:00
..
grabDist.ts Updates 2025-02-03 13:41:13 +01:00
index.ts Updates 2025-02-03 13:41:13 +01:00
README.md Updates 2025-02-03 13:41:13 +01:00

Rebuild your next project incrementally.

Create builds incrementally without stopping your server.

Requirements

There are a few requirements to get this to work

Update your next-config.js file

You need to update the distribution directory in your next-config.js. Like this:

import type { NextConfig } from "next";
import grabDist from "@moduletrace/buncid/dist/rebuilds/next-js/grabDist";

const distDir = grabDist();

const nextConfig: NextConfig = {
    /* config options here */
    reactStrictMode: true,
    distDir,
};

export default nextConfig;

That's it. This dynamically handles your distribution directory for both dev and start scripts. Your development environment uses the .next directory, while your production environment uses the .dist directory.