When I’m the only one working on a site, compiling my Sass files locally and committing the generated CSS isn’t the worst thing in the world. When you’re working in a team environment however, it’s necessary to consider that several developers of different experience levels may touch a site throughout its lifecycle. What would happen if a developer who had never used Sass needed to make an update to a site? How long would it be before someone starts complaining that the change they made to the CSS file was overwritten after the next compilation of the corresponding .scss file?
This technique has one goal: keep generated CSS files out of the git repository. In order to do this, we’ll need to make sure of a few things:
- Generated files are explicitly blocked from the repo (to prevent someone who doesn’t know any better from committing them)
- Automatically recompile our SASS files into CSS upon deployment.