Rails Sass 在快速开发机器中编译太慢 [英] Rails Sass compiles too slow in a fast development machine

查看:33
本文介绍了Rails Sass 在快速开发机器中编译太慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的电脑运行频率为 3.6ghz,内存为 12gb,并使用 Windows 7 和 RailsInstaller 来开发 Rails 应用.

My computer runs at 3.6ghz with 12gb of RAM, and uses Windows 7 and RailsInstaller for developing Rails apps.

当我使用纯 css 时,没有问题,但是当我开始使用 Sass 和 Compass 时,我必须等待 10-15 秒才能刷新才能看到新的变化.(只有在我编辑 .scss 文件时才会发生)

Back when i used pure css, there was no issue, but when i started using Sass and Compass, i have to wait over 10-15 seconds when i refresh to see new changes. (that only happens when i edit a .scss file)

有人知道在相当快的机器上是什么原因造成的吗?

Anyone knows what causes this on a fairly fast machine?

推荐答案

从 sass 3.1.x 更新到 3.2.x,sass 编译时间明显变长.
根据上面的 Roman 的回复,似乎有一个特定的问题,如果您在深度嵌套的选择器中使用 @extend 就会引起这个问题,因为 '@extend' 做了很多处理工作.这里是 github 上 sass 项目当前未解决的问题的链接,用于解决这个确切的问题.

The sass compile times became significantly longer with the update from sass 3.1.x to 3.2.x.
There seems to be a specific concern as per Roman's response above, it's caused if you use @extend in deeply nested selectors since '@extend' does a lot of processing work. Here is the link to a currently open issue on the sass project on github for this exact problem.

话虽如此,关于该问题的报告更像是 90-100 秒的编译时间(对于我自己的个人项目,使用 @extend 大量引入基础/引导类的项目为 104 秒).因此,如果您遇到 9 到 10 秒的延迟,您的问题可能只是一个普遍问题,因为最新更新的编译时间通常较慢.

That being said, the reports on that issue is more like 90-100 sec compile times (104sec for my own personal project that uses @extend alot to pull in foundation/bootstrap classes). So, if you're experiencing 9-10sec lags, yours might just be a general issue with the newest update being generally slower in compile times.

这篇关于Rails Sass 在快速开发机器中编译太慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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