DEV Community

PacHash
PacHash

Posted on

Why Your Side Project Builds Slow: A Simple Fix

I’ve been working on a small project recently and noticed something: the build times kept getting slower. Not because the code was growing, but because I was letting my tools run with their default configs.

One thing that helped a lot was understanding how incremental builds actually work. Many tools (like TypeScript, Webpack, or Rust’s Cargo) don’t rebuild everything—they just rebuild the files affected by changes. But if you’re not careful, you can accidentally break that optimization and force a full rebuild every time.

For example, in TypeScript:

// tsconfig.json
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo"
}
}

This small setting (incremental: true) can cut build times by a lot, especially in bigger projects. Yet many people ignore it because the defaults “just work.”

In Webpack, a similar trick is enabling caching:

module.exports = {
cache: {
type: "filesystem"
}
};

Instead of compiling everything from scratch, Webpack reuses cached results and only recompiles what’s needed.

It sounds obvious, but most projects I’ve cloned on GitHub don’t set this up. The end result is devs waiting 30–40 seconds for a build that could have finished in 5.

Takeaway

Before throwing more hardware at the problem, check your configs. Incremental builds and caching aren’t advanced optimizations—they’re simple switches you can flip. And they’ll save you hours in the long run.

Top comments (0)