0

Is there any other method other than running deploy command to get new changes in the files in Magento 2?

  • 1
    If you are debugging something for a while. You can directly open pub folder css/js file and make changes in it. It will directly reflect the changes without running the commands. But if some one run the deploy command, than your changes will be removed. For css reflecting directly you can just setup grunt also. – Dinesh Rajput Aug 13 at 10:27
  • How to setup grunt in windows? Any tutorial link? – Kowsigan Atsayam Aug 13 at 10:28
  • Please check for grunt setup: tutorialspoint.com/grunt/grunt_installing.htm – Dinesh Rajput Aug 13 at 10:30
1

To Reflect the Changes just Remove that Deployed file in pub/static folder

Magento 2 will auto create the missing/deleted static files.

Created Command For Deleting this :-

rm -rf pub/static/frontend/ pub/static/adminhtml/ pub/static/_requirejs pub/static/deployed_version.txt var/cache var/page_cache var/generation var/view_preprocessed var/session generated/code

For Window Set Developer Mode :-

In Developer Mode Static view files are not cached; they are written to the Magento pub/static directory every time they’re called

bin/magento deploy:mode:set developer
  • I am using windows. Please tell me the commands for windows. – Kowsigan Atsayam Aug 13 at 10:05
  • set developer mode check my updated answer – Rk Rathod Aug 13 at 10:13
  • I already made as developer mode but still the changes are not reflecting without running deploy content. – Kowsigan Atsayam Aug 13 at 10:17
  • 1
    after mode change clear cache and then try – Rk Rathod Aug 13 at 10:19
0

If you want to reflect the JS and CSS changes on the fly, you need to be set the mode to developer, the JS resources will be created as symlinks in the pub folder on the fly and the changes you made either to the ones in the pub folder or the original ones will update both of the files.

For the CSS resources, you will need to remove the compiled one in the pub folder, along with the one in the var/view_preprocessedvar/ folder

0

Check this : https://www.youtube.com/watch?v=1SOeJN6PcJI

Sorry have to entered due to character limit :)

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.