Is there any other method other than running deploy command to get new changes in the files in Magento 2?
-
1If 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 RajputCommented Aug 13, 2019 at 10:27
-
How to setup grunt in windows? Any tutorial link?– Kowsigan AtsayamCommented Aug 13, 2019 at 10:28
-
Please check for grunt setup: tutorialspoint.com/grunt/grunt_installing.htm– Dinesh RajputCommented Aug 13, 2019 at 10:30
3 Answers
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. Commented Aug 13, 2019 at 10:05
-
-
I already made as developer mode but still the changes are not reflecting without running deploy content. Commented Aug 13, 2019 at 10:17
-
1
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
Check this : https://www.youtube.com/watch?v=1SOeJN6PcJI
Sorry have to entered due to character limit :)