Are Netlify builds redundant?

I may be overthinking this, but …

It is starting to bother me that I build and rebuild my site locally until everything works right, then I run the build again in ‘production’ environment so everything is purged and minified. I push the final result to GitHub. GitHub now contains all of my site, except for my final build folder (dist/ in this case). Netlify sees the changes and pulls them in, rebuilding the site. Hopefully in production mode, if I have set it up correctly.

In some ways this feels very redundant, in the sense of “OK, I’ve built the site, it works, now you build it again!”

Additionally, as far as CI goes, Netlify builds aren’t the fastest thing in the world. Each time it downloads and installs pretty much every dependency all over again, or at least it seems that way.

So is there an alternative path, where I can still use Netlify but have it just display my dist/ folder without a build? Would that defeat the purpose of Netlify?

Yeh you could commit your dist directory and not add a build command.

I personally don’t like committing dist code, apart from open source libraries, but each to their own!

1 Like

How about the Netlify drag-and-drop method? Haven’t tried it myself so can’t testify personally to its speed vs. a normal build-on-commit process.

1 Like

Yeh good shout. I’ve used it quite a lot for prototypes and it’s decent

1 Like

Can you expound on that? Is there a reason for this beyond personal preference?

It’s mainly due to when I’ve worked in teams, committed dist code clogs up commits and causes merge conflicts.

Thinking on this further - not being on a team, and since my current template uses del-cli to wipe dist/ every build, this could create a non-trivial number of files to be staged to GitHub. I would also lose the remote copy of my build files.

Yeah, i’ll probably just keep doing it the ‘right’ way :slight_smile: