buncid/rebuilds/next-js/README.md
Benjamin Toby 4540404522 Updates
2025-02-21 09:00:49 +01:00

861 B

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 .buncid-next-dist (or any dist name of your chosing) directory.