指南针手表与Grunt

时间:2013-11-28 11:49:08

标签: gruntjs grunt-contrib-watch

我想创建一个任务来观看我的所有scss文件。我使用了“grunt-contrib-watch”和“grunt-contrib-sass”,但它不起作用。

我的文件和目录:http://glui.me/?i=pz7vmwu9cfgbzt3/2013-11-28_at_12.46_2x.png/

我的错误:

MacBook-Pro-of-username:src username:src$ grunt
Running "cssmin:minify" (cssmin) task
File lib/stylesheets/bottom.min.css created.

Running "watch" task
Waiting...Bus error: 10

我的咕噜声代码:

module.exports = function(grunt){

    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),


        sass: {
            dist: {
                files: {
                    'lib/stylesheets/bottom.css' : 'lib/sass/bottom.scss'
                }
            }
        },

        watch: {
            css: {
                files: '**/*.scss',
                tasks: ['sass']
            }
        },

        cssmin: {
            minify: {
                files: [{
                    'lib/stylesheets/bottom.min.css': ['lib/stylesheets/bottom.css']
                }]
            }
        }

    });

    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-sass');

    grunt.registerTask('default', ['watch']);

}

1 个答案:

答案 0 :(得分:0)

节点< = 0.10.20和OSX mavericks存在问题。将node.js升级到最新版本,它应该解决问题。见https://github.com/gruntjs/grunt-contrib-watch/issues/204