Magento – What are the Magento 2 Grunt commands? From deployment

gruntmagento2

I am developing on Magento 2 EE and I have just setup up my local machine. I notice that after using Composer I can now see Magento 2 EE.

So I ran the command grunt deploy and this basically appeared that it went through a list of CSS LESS and JS files and ran the Grunt. If I was a on live SSH box and I ran grunt deploy will this take the server down or just simply update the files and minify them?

My plan is:

Develop a theme locally with all SASS/LESS and JS files in RequireJS
Copy those files and replace them to live.
Then run grunt deploy on live box.

I take it this is the way it works?

Best Answer

So the Magento 2 grunt commands are the following:

  • grunt clean:<theme> : Removes the theme related static files in the pub/static and var directories.
  • grunt exec:<theme> : Republishes symlinks to the source files to the pub/static/frontend/<Vendor>/<theme>/<locale> directory.
  • grunt less:<theme> : Compiles .css files using the symlinks published in the pub/static/frontend/<Vendor>/<theme>/<locale> directory
  • grunt watch : Tracks the changes in the source files, recompiles .css files, and reloads the page in the browser pages (you need to have LiveReload installed for you browser)

More informations can be found at the following links:

Regarding a deploy command, the only one I'm aware of is to clean CSS cache or refresh LESS files: php bin/magento setup:static-content:deploy

Related Topic