0

When I switch my Magento 2 to developer mode it doesn't do much for me. I practically don't see any benefit from it. When I change something in my plugin it has no effect on the front end. If I change something in JS or HTML it doesn't change it in real time. Only games I call full cleanup commands:

php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento setup:static-content:deploy -f && php bin/magento cache:flush

That's just to see the changes. And these commands take quite a long time about 5 min to load which drives me crazy.

1
  • As documentation, this mode is intended for development. I think is very helpful that shows errors on the frontend, enables automatic code compilation and enables enhanced debugging
    – panosdotk
    Commented Jan 5, 2023 at 20:33

3 Answers 3

1

You can always test your code by making changes in your file present in pub/static/module-name/filename and then if your code is working fine in the static js file, copy that code and paste that in your module's js file.

Ps:- If you run the commands without adding the updated code in your module's js you will lose that recently added code in the static file.

0

Please check the developer mode on this page. https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/setup/application-modes.html

You have to run these commands when you change the static files like js, css, or less file. php bin/magento setup:upgrade Php bin/magento setup:static-content:deploy -f

You can change the static files(magento root directory/pub/static/frontend/your theme/...) directly if you want to test the codes. But you have to update the files again in the app directory after you tested it.

I want this will help you.

0

it happens most of the time, so please use below command and you will see your changes for sure. got the you magento installation root directory and run below commad

sudo rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* pub/static/frontend/*
sudo chmod -R 777 var/ generated/ pub/static

after it refresh your page with (ctrl+f5) command. if sill you do not see your changes then please run

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

sudo chmod -R 777 var/ generated/ pub/static

I hope it will resolve your issues. please like if it is useful.

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.