LESS 1.3.3,监视模式在espresso编辑器中占用大量CPU [英] LESS 1.3.3, watch mode hogging a lot of CPU in espresso editor

查看:58
本文介绍了LESS 1.3.3,监视模式在espresso编辑器中占用大量CPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我偶然使用的是更低版本(1.2.1)的旧版本,当我将.js更新为最新版本(1.3.3)时,看来我的html/css编辑器Espresso现在占了40% cpu,在开发/观看模式下最高可达90%.我试过其他版本,似乎发生在1.3.1+.我尝试了不同的观看模式变化,甚至完全禁用了它,并且仍在使用40-50%的CPU.我现在基本上不能使用它.

I was using an older version of less (1.2.1) by accident and when I updated the .js to the most recent version (1.3.3) it seems that Espresso, my html/css editor, now takes 40% cpu and up to 90% when in development/watch mode. I've tried other versions and it seems like it happens with 1.3.1+. I've tried different variations of the watch mode and even disabling it completely and it's still using 40-50% cpu. I basically can't work with it now.

edit:看来这主要是由观看模式引起的,我高度依赖:(

edit: It seems like it's mostly being caused by watch mode, which I highly depend on :(

这是我的网站负责人的样子.任何建议将不胜感激,因为我根本不了解js.

This is what my site head looks like. Any suggestions would be appreciated as I do not understand js at all.

<!doctype html>
<html>

<head>

<meta charset="utf-8"/>

<title>Article Sample</title>

<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/ -->


<!-- Link directly to LESS stylesheet first -->
<link rel="stylesheet/less" href="style/default.less" type="text/css" media="screen" />
<link rel="stylesheet/less" href="style/tablet.less" type="text/css" media="screen" />
<link rel="stylesheet/less" href="style/mobile.less" type="text/css" media="screen" />
<link rel="stylesheet/less" href="style/wide-mobile.less" type="text/css" media="screen" />

<!-- Then link to LESS, and enable development watch mode -->
<script src="js/less-1.3.3.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
    less.env = "development";
    less.watch();
</script>
<!-- Voilà! Instant LESS previews in Espresso -->

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

</head> 

推荐答案

我认为最好先进行预编译,然后再使站点读取已编译的.css.

I think it is better to precompile first and then make the site read the already-compiled .css instead.

您可以使用Koala应用程序预编译less文件,也可以使用grunt来摆脱less.js.

You can use Koala app for precompiling the less file or you can use grunt too, and get rid of the less.js.

这篇关于LESS 1.3.3,监视模式在espresso编辑器中占用大量CPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆