Do we have to delete .gitignore within Roots folder for production to use minified files?

Hey all,

I’ll give some context of my setup, which I think the source of the problem I stated above. I don’t know if this is the default behavior but without removing some lines in .gitignore my production breaks (no css, js files with those hashes are loaded).

I use PagodaBox to host my git-powered workflow for WordPress + Roots combo. I’ve used BedRock for some setup on Digital Ocean before, but PagodaBox makes keeping the git-workflow while deploying to the cloud/server much smoother. Here’s some visual of what I’m talking about: http://quick.as/XRW3h2g4

I’ve created a recipe that will work with PagodaBox right away if you want to replicate it: GitHub - ajmalafif/pagopress: Boilerplate for WordPress Skeleton + Roots Theme + Composer + PagodaBox.

Please see here: https://github.com/roots/roots/blob/master/lib/scripts.php#L22

Hey there,

Yeah was aware of that and tried putting

define('WP_ENV', 'development');

inside wp-config.php and doesn’t work (even tried on local-config.php).

So I ended up have to modify the .gitignore file and it works now…

I think it’s confusing to have the css and js files gitignored - when you deploy to production the files aren’t there.

So I had to add:

!assets/css/main.min.css
!assets/js/scripts.min.js

to the /web/app/themes/roots/.gitignore file

Why is main.min.css and scripts.min.js in .gitignore to begin with?

Because those assets shouldn’t be in your repository. See https://github.com/roots/roots/pull/1257#issuecomment-70195437 by @austin

1 Like

Also a bit more in-depth: http://austinpray.com/ops/2015/01/15/build-steps-and-deployment.html

2 Likes

Sweet, thanks for the resources!