Css changes reflect only after deploy command in magento2

こ雲淡風輕ζ 提交于 2019-12-07 09:00:40

问题


Now i have created custom theme in magento2.Every time i wrote css it doesn't reflect immediately.I have changed mode to "developer".And also disable cache in backend.I have given the following commands to reflect my custom css.

rm -f var/* -R

rm -f pub/static -R

php bin/magento setup:static-content:deploy

chmod 0777 var -R

chmod 0777 pub/static -R

It takes too much time to do my design work.So please anyone help on this.


回答1:


The solution suggested by Emizen Tech works fine and helps me out to resolve the same issue in my site.

However, it only requires mode to be set to the developer.

In order to change the mode, here is the command:

bin/magento deploy:mode:set developer



回答2:


you can just write css/js for theme in the app/design same folder

to reflect the changes just remove that deployed file in pub/static folder

Magento2 will auto create the missing/deleted static files

Make sure that pub/static/.htaccess should be there for auto generation of Static Files. as I can See you have removed the all files and folder into pub/staic folder

copy this .htaccess file form Magento's GIT Repo. : https://github.com/magento/magento2/blob/develop/pub/static/.htaccess




回答3:


Easy way to directly change in pub/static folder and then it complete put this change in app/design folder that make it faster.



来源:https://stackoverflow.com/questions/37495665/css-changes-reflect-only-after-deploy-command-in-magento2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!