I have an app.less that imports everything (less) else if I comment a line in app.less app styles doesn't render the commented part, but if I change something in that imported less file, anything changes, I have to do cache:clear
and to clear the browser cache to see the new style loaded...
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Assets that are imported from another stylesheet (less, sass, whatever) will not be recompiled when they change, even if you use php app/console assets:dump --watch
. See another question on StackOverflow and this issue in the AsseticBundle
issue queue.
回答2:
I came upon the same problem. This is caused because LESS is using your window.localstorage
to save the rendered css file. For testing you could put in javascript
<script> /* Provisory for dev environment: */ window.localStorage.clear(); </script>
however this causes your page to load really slow. i have not found another options for this just yet.