Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

62%
+3 −1
Q&A What would the pros and cons of storing the compiled CSS output of SASS in version control?

One thing to consider if you decide to store the CSS in version control is how to make sure that the CSS is always updated whenever the SASS is updated. (Of course this is true of the more general ...

posted 3y ago by r~~‭

Answer
#1: Initial revision by user avatar r~~‭ · 2020-10-22T17:03:50Z (over 3 years ago)
One thing to consider if you decide to store the CSS in version control is how to make sure that the CSS is always updated whenever the SASS is updated. (Of course this is true of the more general question, not just about CSS and SASS.) My preferred way to do that is to add a pre-commit hook to the project that runs the build scripts for any built files I'm keeping in version control.

The nature of the pre-commit hook will depend on what version control system you're using. If you're using Subversion, for example, you can [add the hook](http://svnbook.red-bean.com/en/1.7/svn.reposadmin.create.html#svn.reposadmin.create.hooks) to the Subversion server; if you're using Git, you *could* just add the hook into your [`.git/hooks` directory](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) manually, but I'd recommend using a tool like [Husky](https://www.npmjs.com/package/husky) so that anyone else who works on your project will get the same hooks.

So to answer your question directly: one con of keeping derived files in version control is having to set up the above, or possibly letting your derived files slip out of date with their sources.