2014-07-13 2 views
0

내 watch 명령은 sass를 제외한 모든 작업을 실행합니다. 나는 툴툴 거리는 소리 말대꾸를 실행하면, 나는 다음과 같은 메시지가 오류가 나타납니다그라스가 sass 명령을 실행하지 않음

Warning: You need to have ruby and sass installed and in your path for this task to work.

이 메시지가 나는 루비 콘솔을 통해 .scss에서 내 .css 파일을 생성 할 수 있기 때문에 보여 주었다 이유를 모르겠어요 (말대꾸를 - styles/scss/general.scss : styles/css/general.css)를보고, Ruby와 sass를 모두 설치했습니다.

내 Gruntfile.js는 다음과 같습니다 :

module.exports = function(grunt) { 

// 1. All configuration goes here 
grunt.initConfig({ 
    pkg: grunt.file.readJSON('package.json'), 

    concat: { 
     dist: { 
      src: [ 
       'js/libs/*.js', // All JS in the libs folder 
      ], 
      dest: 'js/build/production.js', 
     } 
    }, 

    uglify: { 
     build: { 
      src: 'js/build/production.js', 
      dest: 'js/build/production.min.js' 
     } 
    }, 

    imagemin: { 
     dynamic: { 
      files: [{ 
       expand: true, 
       cwd: 'images/', 
       src: ['**/*.{png,jpg,gif}'], 
       dest: 'images/optimized/' 
      }] 
     } 
    }, 

    sass: { 
     dist: { 
      options: { 
       style: 'compressed' 
      }, 
      files: { 
       'styles/css/general.css': 'styles/scss/general.scss' 
      } 
     } 
    }, 

    watch: { 
     scripts: { 
      files: ['**/*.{png,jpg,gif}', 'js/libs/*.js'], 
      tasks: ['imagemin', 'concat', 'uglify'], 
      options: { 
       spawn: false, 
      } 
     }, 
     sass: { 
      files: ['css/*.scss'], 
      tasks: ['sass'] 
     } 
    } 

}); 

// 3. Where we tell Grunt we plan to use this plug-in. 
grunt.loadNpmTasks('grunt-contrib-concat'); 
grunt.loadNpmTasks('grunt-contrib-uglify'); 
grunt.loadNpmTasks('grunt-contrib-imagemin'); 
grunt.loadNpmTasks('grunt-contrib-watch'); 
grunt.loadNpmTasks('grunt-contrib-sass'); 
grunt.loadNpmTasks('grunt-contrib-compass'); 

// 4. Where we tell Grunt what to do when we type "grunt" into the terminal. 
grunt.registerTask('default', ['concat', 'uglify', 'imagemin', 'watch', 'sass']); 

};

내 OS는 Windows7입니다. 어떤 생각?

답변

0

var config = { 
    app: 'app', 
    dist: 'dist' 
}; 

grunt.initConfig({ 
sass: { 
     dist: { 
      options: { 
      style: 'compressed' 
      }, 
      files: [{ 
      cwd: 'styles/scss/', 
      src: '*.scss', 
      dest: 'styles/css/', 
      ext: '.css' 
      }], 
     }, 

watch: { 
    sass: { 
      files: ['styles/scss/{,*/}*.scss'], 
      tasks: ['sass'], 
      options: { 
       livereload: true 
      } 
     } 
} 
}; 

을 시도하고 grunt.initConfig

전에 상단에있는 모든 grunt.loadNpmTasks 배치하는 것이 좋습니다 것
관련 문제