3
  1. I have a local repo with my Magento 2 development environment. I use grunt watch to compile my local less files.
  2. I push my edited less file with Git to my Beanstalk remote Develop branch
  3. I deploy (pull) those commits with Beanstalk to my staging server, so my client is able to see my changes online.

But I don't see any changes? How do I produce my CSS (from my less files) on the staging server?

3

Grunt is a Node Js package, to make the Grunt commands can work, we need to install Node Js on your Staging Server. However, this way doesn't recommend. We can deploy static content in both ways: Grunt and Deploy command, but Grunt is preferred in development stage and static content deploy command in staging and production stage.

In your case, we need to delete the static content pub/static/frontend, and run static deploy command on the Staging server. Don't need to install Node Js to use Grunt.

We can read more: https://magento.stackexchange.com/a/137215/33057

1

First you have to run below commands:

 - grunt exec:themename

 - php bin/magento setup:static-content:deploy

 - grunt less:themename

then whenever you push commits you have to run grunt less:themename (if there are no new file added), if you add new file in commits then you have run all three command which are mentioned above.

if still not working then you have to remove pub/static/frontend and var/view_preprocessed folder and run above commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.