I’ve installed the latest version of Roots for a new project and I’m trying to wrap my head around these new Grunt commands.
Before I would just write grunt watch in the terminal and whenever I saved my changes to the .less files it would compile the main.min.css and those changes would be reflected in the browser.
Now with Roots 7.0 when I use grunt watch it creates the main.css but the page still wants to load the minified version from the grunt build.
So basically whats the difference, in the simplest terms, between grunt watch/dev/build? Iss there a way for me to set it up the gruntfile so that I can just write grunt watch once and the main.min.css will be made every time I make a change?
I don’t want to make any unnecessary changes if the current set up is the best way.
Cool, thanks for your help. I had added define('WP_ENV', 'development'); before making this post but it still wasn’t working. I then set up the grunt file like this, which I found in another thread:
Nobody can help with general confusion. If there is something specific you’re still confused about after reading the posts above then I can try to clear up your confusion.
I think my confusion is mostly about Grunt and not about Roots at all. You are right, nobody can help with general confusion.
In other way, maybe Gulp is less confusing. I don’t know.
When I write grunt dev in terminal Grunt creates style and script file
When I write grunt build Grunt creates the min version.
When I write both commands in terminal I have production and development version of the files. My confusion was about that because some scripts were loaded twice, also when I did git status Git give me untracked files. And manually I have to delete dev version of css/script in order to make a push for the production files.
@cfx is WP_ENV specific to roots? That isn’t really clearly explained anywhere that I can see. I don’t think its unreasonable that one might assume this is a WordPress constant used by core but a search of core reveals that isn’t the case.
How would I get this added to the roots docs? i.e. contribute something and do it myself?