问题描述
我在JS模式(less.js)中使用Less,方法如下:
I'm using Less in JS mode (less.js) the following way:
<link rel="stylesheet/less" href="assets/styles/less/bootstrap.less" media="all">
<script src="assets/scripts/libs/less-1.1.5.min.js"></script>
在一些页面查看后,它停止处理样式并提供缓存版本。为了使它重新解析样式,我必须清除浏览器cookie。有人知道为什么是这样吗?是否有任何选项,使其在每个页面视图重新解析?
非常感谢!
And after some page views, it stops processing the styles and gives a "cached" version. To make it re-parse the styles I have to clear browser cookies. Does anybody knows why is this? Is there any option to make it re-parse on every page view?Thanks a lot!
UPDATE:查看一些库代码,似乎使用localStorage将样式表存储为缓存。它基于文件的最后一次修改时间来更新该缓存,但由于某些原因,它不能正常工作,因为它没有采取我的更改...
UPDATE: Reviewing some of the library code, seems that it uses localStorage to store the stylesheets as a cache. It bases on file's last modified time to update that cache but for some reason it's not working properly because it's not taking my changes...
推荐答案
为此,我在GitHub上找到了一个。引用自己:
I just found a issue in GitHub for this. Quoting myself:
<script> /* Provisory for dev environment: */ localStorage.clear(); </script>
这篇关于LessCSS停止处理样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!