Course contentsShow
← Web Development
Lesson 1813 of 2,98233. Static Site Generation and JamstackFree lesson

Build Configuration

Setting build commands, output directories, and framework-specific settings per platform.

Build Configuration

You'll learn how to configure build commands, output directories, and framework-specific settings when deploying static sites to various platforms.

Understanding Build Configuration

Build configuration is your deployment checklist—it tells your hosting platform exactly how to transform your source code into a ready-to-serve website. Every static site generator has its own build process, and every platform needs to know three essential pieces of information: what command builds your site, where the built files end up, and any special framework requirements.

Think of it like giving instructions to a chef: you specify the recipe (build command), where to find the finished dish (output directory), and any dietary restrictions or special equipment needed (framework settings).

The Three Core Settings

Build Command: The terminal command that compiles your site. For Next.js, it's typically npm run build. For Eleventy, it might be npx @11ty/eleventy. This command transforms your source files, fetches build-time data, and generates static HTML, CSS, and JavaScript.

Output Directory: Where your built site lives after compilation. Next.js outputs to .next or out (depending on configuration), Gatsby uses public, and Eleventy defaults to _site. Your platform must know this directory to serve the correct files.

Framework Detection: Modern platforms like Netlify and Vercel auto-detect popular frameworks and preset these values. You can override them when using custom configurations or monorepos.

Platform-Specific Adjustments

Some platforms require additional settings. You might specify a Node.js version, enable certain build plugins, or configure environment-specific optimizations. These settings ensure your build environment matches your local development setup.

Key Takeaway: Build configuration connects your framework's build process to your deployment platform by specifying the build command, output directory, and framework-specific requirements—ensuring your static site generates correctly in production.