0

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.

asked Sep 15, 2020 at 8:59
2
  • Are you saying you do not want static content deploy to change any files? Commented Sep 15, 2020 at 9:15
  • yes i want to directly see my changes not always want to run command@BenCrook Commented Sep 15, 2020 at 10:03

1 Answer 1

0

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.

answered Sep 15, 2020 at 10:08
4
  • Thanks for your response i have one question is it same for JS File.@Ben Commented Sep 15, 2020 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. Commented Sep 15, 2020 at 10:46
  • Thanks for the response it really helps. Commented Sep 15, 2020 at 11:24
  • have any post or module on checkout module which have checkout steps and save data for loggedin and guest users. Commented Sep 15, 2020 at 11:26

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.