LESS css - JS Parser vs Compiled

冷暖自知 提交于 2019-12-12 11:12:05

问题


I was wondering if anyone knew if the JS interpreter for LESS css causes any noticeable delays in page loading. I would prefer to use the JS parser simply because it's easier to use, since I won't have to run the compiler after every edit and easier to manage the source code as SCM tools won't be tracking both the .less and .css files


回答1:


Its not slow on fast computers/browsers. However depending on your target audience I wouldn't use it.

I would rather setup lessc to watch a file/directory and generate css files on save. And then commit both the less and the css files to your SCM (that is infact what I do).

Also doing it this way allows for continuous integration builds.

http://en.wikipedia.org/wiki/Continuous_integration




回答2:


I would also suggest parse LESS styles into normal CSS. There're still people who have JS turned OFF or who use some JS-blocking addons. In such case, you'll get unstyled page, which is not the best way to impress your audience.

If you're on Mac - try Less.App If you're on Windows - try WinLess If you're on Linux - try SimpleLess

All applications have an Option to "watch directory" (with LESS styles) and compile automatically if changed. Less.App & WinLess have a lot of other options like: compile minified, start with system, start minimized, etc...



来源:https://stackoverflow.com/questions/10423964/less-css-js-parser-vs-compiled

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