Should we keep using Grunt on the server or on my local machine in Magento 2

Spread the love

magento 2 grunt,magento 2 grunt watch not working,how to use grunt in magento 2,magento 2 compile less,compile less with grunt magento 2,magento 2 client side less compilation,magento 2 unable to find local grunt,magento 2 livereload

if you just starting work in magento 2 and getting slightly confused with grunt and magento 2. Should you keep using Grunt on the server or on your local machine? if you facing this type of confusion then read this post till end.

Local machine. You don’t need to run it in production, because you should be running setup:static-content:deploy with the Magento CLI when deploying to production, which will compile all static content for you.

For development, Magento 2 provides a Gruntfile.js.sample and a package.json.sample for local development. You should rename them to Gruntfile.js and package.json, and then install the dependencies with npm install. As long as you have grunt installed, you should be able to then run the grunt commands to compile your code while you are developing. You can see more info and the grunt commands here: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css_debug.html

You should also make sure that you are running your local development environment in “developer mode”: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html#change-to-developer-mode

Grunt should be used locally and staging, whenever you have the application in developer mode. In production mode (live site) it shouldn’t be used.

Leave a Reply

Your email address will not be published. Required fields are marked *