How to prevent from static content deploy after changing in JS or CSS file in Magento 2. After doing some little change changes are not loads in front end if doesn't deploy.

How to do that Any help is appriciated.

  • Are you saying you do not want static content deploy to change any files? – Ben Crook Sep 15 '20 at 9:15
  • yes i want to directly see my changes not always want to run command@BenCrook – Prits Sep 15 '20 at 10:03

You can use Grunt to compile your CSS which means you do not have to run the static content deploy command. See https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/css-topics/css_debug.html for installation steps.

Once installed you can run grunt watch which will compile your files automatically when you save any changes.

If you don't want to install Grunt another option is to use client-side compilation but it can be quite slow, you can set this by going to STORES > Settings > Configuration > ADVANCED > Developer > Frontend development workflow > Workflow type and setting it to client side.

  • Thanks for your response i have one question is it same for JS File.@Ben – Prits Sep 15 '20 at 10:17
  • 1
    Yeah, Javascript does not need compiling so if you're not seeing JS changes it will likely be your browser and/or Magento cache - both of these can be disabled. – Ben Crook Sep 15 '20 at 10:46
  • Thanks for the response it really helps. – Prits Sep 15 '20 at 11:24
  • have any post or module on checkout module which have checkout steps and save data for loggedin and guest users. – Prits Sep 15 '20 at 11:26

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.