标签: grunt-contrib-compass

指南针和手表的咕噜声编译缓慢

Grunt需要很长时间来编译css文件,我不确定这是否正常但是常规指南针需要大约5秒钟.

所以问题是如果有任何方法可以加快Grunt的编译时间,或者只是坚持使用罗盘手表?

Running "compass:dist" (compass) task
?unchanged images/sprite-sf580a96666.png
overwrite stylesheets/app.css (3.263s)
unchanged images/sprite-sf580a96666.png
overwrite stylesheets/app_fr.css (3.289s)
Compilation took 11.116s

Running "watch" task
Completed in 13.974s at Wed Dec 18 2013 13:53:05 GMT-0500 (Eastern Standard Time- Waiting...
OK
>> File "scss\_core.scss" changed.
Run Code Online (Sandbox Code Playgroud)

Gruntfile.js:

compass: {
        dist: {
            options: {
            config: 'config.rb'
            }
        }
    },

    watch: {
        sass: {
            files: ['scss/*.scss'],
            tasks: ['compass:dist'],
            options: {
                spawn: false,
            }
        },
        scripts: {
            files: ['js/*.js'],
            tasks: ['concat', 'uglify'],
            options: {
                spawn: false,
            }
        } …
Run Code Online (Sandbox Code Playgroud)

performance watch gruntjs grunt-contrib-watch grunt-contrib-compass

9
推荐指数
2
解决办法
1万
查看次数

指南针插座挂断与咕噜声服务

我正在运行grunt-contrib-compass@0.6.0并且它因此错误而中止:

node_modules/grunt-contrib-compass/node_modules/tmp/lib/tmp.js:261
  throw err;
        ^
Error: socket hang up
at createHangUpError (http.js:1476:15)
at Socket.socketCloseListener (http.js:1526:23)
at Socket.emit (events.js:95:17)
at TCP.close (net.js:465:12)
Run Code Online (Sandbox Code Playgroud)

我升级到grunt-contrib-compass@1.0.1,现在它不再退出,但它会产生以下错误/警告(当发生这种情况时它不再退出,即使它说致命)

Fatal error: socket hang up
Fatal error: socket hang up
Run Code Online (Sandbox Code Playgroud)

我只能假设更好的错误处理是同样的问题.是否有某种方法可以从抛出此错误的内容中获取更好的信息?这是我的Gruntfile的指南针部分

    compass: {
        options: {
            sassDir: '<%= yeoman.app %>/styles',
            cssDir: '.tmp/styles',
            generatedImagesDir: '.tmp/images/generated',
            imagesDir: '<%= yeoman.app %>/images',
            javascriptsDir: '<%= yeoman.app %>/scripts',
            fontsDir: '<%= yeoman.app %>/fonts',
            importPath: '<%= yeoman.app %>/bower_components',
            httpImagesPath: '/images',
            httpGeneratedImagesPath: '/images/generated',
            httpFontsPath: 'styles/fonts',
            relativeAssets: false,
            trace: true
        },
        dist: {},
        server: {
            options: {
                debugInfo: true …
Run Code Online (Sandbox Code Playgroud)

gruntjs grunt-contrib-compass

6
推荐指数
0
解决办法
411
查看次数

几个CSS输出与grunt-contrib-compass

grunt-contrib-compass用来将我的SCSS文件处理成一个CSS文件.基本上,罗盘考虑所有匹配的SCSS文件app/styles/**/*.scss并将其编译成.tmp/styles/main.css.

我想将此行为分为:

  1. app/styles/specific/**/*.scss.tmp/styles/specific.css
  2. app/styles/**/*.scss.tmp/styles/main.css(忽略specific)

但是,我不知道如何配置关于我的配置文件的grunt非常简单:

options: {
    sassDir: '<%= yeoman.app %>/styles',
    cssDir: '.tmp/styles',
    imagesDir: '<%= yeoman.app %>/images',
    javascriptsDir: '<%= yeoman.app %>/scripts',
    fontsDir: '<%= yeoman.app %>/styles/fonts',
    importPath: '<%= yeoman.app %>/bower_components',
    relativeAssets: true
}
Run Code Online (Sandbox Code Playgroud)

我无法找出任何解决方案,特别是因为罗盘文档说明cssDir并且sassDir只允许字符串作为参数.这是否必须在其他任务中完成?

sass gruntjs compass-sass grunt-contrib-compass

5
推荐指数
1
解决办法
4338
查看次数

如何更新/修复 SASS 和 Compass $PATH 以使用 grunt-contrib-compass

我正在尝试运行 grunt-contrib-compass,但遇到此错误:

Warning: Couldn't find the `compass` binary. Make sure it's installed and in your $PATH Use --force to continue.
Run Code Online (Sandbox Code Playgroud)

我跑了:

  • sudo gem install compass
  • sudo gem install sass
  • sudo gem update --system

当我做 gem list 时,我得到:

compass (1.0.1) 
rails (4.1.6)
sass (3.4.5, 3.3.4)
Run Code Online (Sandbox Code Playgroud)

红宝石:

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
Run Code Online (Sandbox Code Playgroud)

关于如何让 grunt-contrib-compass 工作的任何建议或解决方案?

ruby compass-sass grunt-contrib-compass

5
推荐指数
1
解决办法
3988
查看次数

Compass和Susy需要不同版本的Sass

我正在我的网站上工作,我想使用Susy和Compass.我也在使用Grunt.当我运行我的grunt任务时,我收到此错误:

Denniss-MacBook-Pro:portfolio dennis$ grunt --trace
Running "compass:dev" (compass) task
Gem::LoadError on line ["1990"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb: Unable to activate susy-2.1.1, because sass-3.2.17 conflicts with sass (~> 3.3.0)
Run with --trace to see the full backtrace
Warning: ? Use --force to continue.

Aborted due to warnings.
Run Code Online (Sandbox Code Playgroud)

这是我的Grunt文件:

module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

watch: {
  options: {
    livereload: true
  },
  css: {
    files: ['_sass/*.{scss,sass}'],
    tasks: ['compass:dev']
  },
  js: {
    files: ['js/*.js'],
    tasks: ['uglify']
  }
},

compass: {
  options: {
    require: 'susy' …
Run Code Online (Sandbox Code Playgroud)

sass gruntjs susy-compass grunt-contrib-compass

4
推荐指数
1
解决办法
1794
查看次数

Grunt + Compass不会创建CSS文件

使用时出现以下错误grunt compass:

"您必须从项目目录中编译单个样式表."

我用3种不同的方式尝试了它.更多下面.

我的文件夹结构:

test \
     Gruntfile.js
     package.json
     \ node_modules \
     \ _src \ (this is the root folder of my Jekyll site)
        \ config.rb
        \ index.html
        \ static/
            \ _sass \
            \ css \
            \ images \
            \ js \
Run Code Online (Sandbox Code Playgroud)

什么有效:

一切正常,无需使用grunt和使用/_src/config.rb:

#project_path = "_src/"
http_path = "/"
css_dir = "css"
css_path = "static/" + css_dir
sass_dir = "_sass"
sass_path = "static/" + sass_dir
images_dir = "images"
images_path = "static/" …
Run Code Online (Sandbox Code Playgroud)

sass node.js gruntjs compass-sass grunt-contrib-compass

4
推荐指数
1
解决办法
3896
查看次数