4

自从更新到最新版本的 Compass 后,现在编译需要 4.294 秒。

由于需要,我需要这个版本的指南针susy

Running "sass:dist" (sass) task
Running "watch" task
Completed in 4.294s at Tue Sep 30 2014 23:38:01 GMT+0200 (W. Europe Daylight Time) - Waiting...`

// Running versions

compass -v 1.0.1
susy    -v 2.1.3
sass    -v 3.4.4

我用 grunt 编译:

    sass: {                              
        dist: {                          
            options: {                   
                style: 'compressed',
                require: 'susy',
                compass: true
            },
            files: {                     
                '<%= yeoman.css %>/style.css': '<%= yeoman.sass %>/style.scss'
            }
        }
    }

如何加快编译时间?我的配置有问题吗?

4

2 回答 2

2

这不是配置问题,它是最新的 Sass & Compass 中已知的性能回归

于 2014-10-15T21:29:32.727 回答
0

遇到同样的问题,拔头发想解决,但终于找到了;就是降级。

从编译 2 分钟以上到 25 秒。

就是这样:

  1. 您需要安装这些(如果您使用 OSX):

    http://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages

  2. 安装包

    gem install bundle

  3. 在您的根文件夹中创建一个 Gemfile,将其命名为“ Gemfile

# frozen_string_literal: true
source "https://rubygems.org"

# gem "rails"
gem 'sass', "3.2.9"
gem 'sass-globbing', ">= 1.1.0"
gem 'compass', "0.12.2"
gem 'breakpoint',  "2.0.5"
gem 'singularitygs', "< 2.0.0"
gem 'bootstrap-sass'

  1. 安装 GemFile 并更新它

    bundle install && bundle update

  2. 然后用 bundle 运行 compass

    time bundle exec compass compile <path>

我将这些版本保留了一段时间,直到它们解决了性能问题。希望能帮助到你!

于 2017-02-27T07:43:54.843 回答