jQuery, which gets used if the Google CDN can’t be reached
I’ve found three different ways people are dealing with this:
Remove the files from .gitignore and commit them.
Build the files on production.
Build the files locally and copy them to production.
What approach do you prefer? Is anyone using another approach that I haven’t seen?
I’m adding the files to Git right now, but I’m leaning toward building them in production. Getting away from Git-based deploys completely is another option, but I’m not sure it would be worth the effort.
They’re in the Roots .gitignore but that has little to do with using Roots as your theme when you’re deploying with Bedrock. That .gitignore is the Roots theme’s file and since Roots isn’t meant to be used as a child theme you can safely remove it and the .git/ directory from your theme. And you probably should.
Exactly? That’s the best way to guarantee consistency since they go through the same process as you did. Obviously it should produce the same output but who knows.
To me, production assets are a build artifact. Anything that’s the output of a build process shouldn’t be committed to source control. It also prevents anyone from EVER just doing some quick temporary change to a production asset and not reflecting it in the actual source files.
I like the simplicity of just removing the .gitignore file from the Roots directory, but it does add a lot of extra files into version control.
My Roots directory has 69 files under version control now, removing the .gitignore from Roots adds 376 more. Most of these are the uncompiled bits of Bootstrap, jQuery, and Modernizer, plus quite a few documentation files. Bower pulls in a lot of unnecessary crap, since it just copies the entire repository for each library.
Hopefully in the next couple of weeks I’ll get around to writing posts on the other two options that don’t require adding the built assets into Git.