grunt imagemin错误:致命错误:写EPIPE

时间:2015-04-07 20:44:51

标签: build gruntjs grunt-contrib-imagemin imagemin

我在运行grunt dist时遇到上述错误,它与我的其他机器完美配合。 请找我的gruntfile。

$ grunt imagemin。

跑步" imagemin:png" (imagemin)任务  缩小了132张图片(保存134.02 kB)

跑步" imagemin:gif" (imagemin)任务

  

致命错误:写EPIPE

module.exports = function(grunt) {

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

    connect: {
        server: {
            options: {
                port: 9001,
                livereload: true,
                hostname: 'localhost',
                base: ['.']
            }
        }
    },

    watch: {
        options: {
            livereload: true
        },

        all: {            
                files: ['Content/**/*.scss'],
                tasks: 'sass'                                     
        }
    },

    open: {
        all: {
            path: 'http://localhost:9001/app/index.html'
        }
    },

    concat: {
        style: {
            src: [ 
            "Content/font-awesome/css/font-awesome.min.css",
            "Content/scss/all.scss",
            "Content/scss/_buttons.scss"],
            dest: 'Content/dist/scss/style.scss'
        },

        ie: {
            cwd: 'Content',
            expand: true,
            src: [
                "scss/ie9.scss",
                "scss/ie8.scss"
            ],
            dest: 'Content/dist'
        }
    },

    sass: {            
        dist: {
            options: {
              style: 'expand',
              compass: true,

            },

            files: {
                'Content/dist/css/style.css': 'Content/dist/scss/style.scss',
                'Content/dist/css/ie8.css':   'Content/dist/scss/ie8.scss',
                'Content/dist/css/ie9.css':   'Content/dist/scss/ie9.scss'
            }
        }
    },   

    cssmin: {
        css:{
            files: {
              'Content/dist/ie8.css':   'Content/dist/css/ie8.css',
              'Content/dist/ie9.css':   'Content/dist/css/ie9.css',
              'Content/dist/style.css': 'Content/dist/css/style.css'
            }
        }
    },

    imagemin: {
        png: {
            files: [{
                expand: true,
                cwd: 'Images/',
                src: '**/*.png',
                dest: 'Images/dist/'
            }]
        },

        gif: {
            files: [{
                expand: true,
                cwd: 'Images/',
                src: '**/*.gif',
                dest: 'Images/dist/'
            }]
        },

        ico: {
            files: [{
                expand: true,
                cwd: 'Images/',
                src: '**/*.ico',
                dest: 'Images/dist/'
            }]
        },

        jpg: {
            files: [{
                expand: true,
                cwd: 'Images/',
                src: '**/*.jpg',
                dest: 'Images/dist/'
            }]
        },

        jpeg: {
            files: [{
                expand: true,
                cwd: 'Images/',
                src: '**/*.jpeg',
                dest: 'Images/dist/'
            }]
        }
    },

    clean: {
        build : {
            src: ['Content/dist/', 'Images/dist', 'Scripts/dist']
        },

        scss: {
            src: ['Content/dist/scss', 'Content/dist/css']              
        },
        map: {
            src: 'Content/dist/css/*.map'
        },
        js: {
            src: ['Scripts/temp']
        }
    },     

    compass: {            
        dist: {
            options: {
                sassDir: 'app/sass',
                cssDir: 'Content/dist/css'
            }
        }
    }
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');    
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-open');

grunt.registerTask('server', function() {

    grunt.task.run([           
        'connect',
        'open',
        'watch'
    ]);

});    

grunt.registerTask('dist', 'Running the minification job for production', function() {

    grunt.task.run([
        'clean:build',
        'concat',
        'sass',
        'cssmin',
        'imagemin',
        'clean:scss',
        'clean:js'           

    ]);

  });
};

0 个答案:

没有答案