0

I'm working on a Magento 2.3.4 website that has a custom theme, developed by a different party. I need to modify some .less files and I noticed something strange. grunt exec, that should publish the symlinks to pub/static/frontend generates the same results as running bin/magento setup:static-content:deploy. By the same results I mean that the rendered page looks the same after a grunt exec as it does after the native Magento command.

However, if I run grunt less after the grunt exec, the page renders completely differently. Styles that were not applied before are suddenly applied. This lets me modify styles that I otherwise can't – because just running grunt exec does not pick up those changes –, but it also results in the site looking completely different than in production.

Does anyone have any idea what could be going on?

1 Answer 1

0

the rendered page looks the same after a grunt exec as it does after the native Magento command

grunt exec creates symlinks, it doesn't compile styles (less -> css); if you check pub/static/.../css after executing grunt exec you'll find only styles-l.less and styles-m.less, the css isn't compiled on this step. when you execute grunt exec and reload the page the css actually gets compiled on server side - same way as if you'd run s:s:d

the page renders completely differently

  1. compare ./dev w/ same folder on clean Magento. you might find customization in grunt configs/tasks
  2. try compiling static w/ disabled 3rd-party modules (php bin/magento module:status | grep -v Magento | grep -v List | grep -v None | grep -v MSP_ReCaptcha | grep -v -e '^$'| xargs php bin/magento module:disable)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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