5

当我运行 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'           

    ]);

  });
};
4

0 回答 0