R
R
Ramil2015-04-15 18:21:49
Grunt.js
Ramil, 2015-04-15 18:21:49

Why does grunt give Fatal error: Unsupported interlance method?

Grunt sprite throws an error when run on the command line

Fatal error: Unsupported interlance method?

I need the grant to generate sprites for me, but he does not want to do this. I work under Windows, I use naturally git bash. I have installed all nodejs modules.
module.exports = function(grunt) {
    // 1. Вся настройка находится здесь
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: { //объединение файлов
            dist: {
                src: ['js/libs/*.js'],
                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_build/'
                }]
            }
        },
        sass: {
            dist: {
                options: { // Target options
                    style: 'expanded'
                },
                files: {
                    'css/global.css': 'css/global.scss'
                }
            }
        },

        sprite:{
            dist: {
                src: ['sprites/*.png'],
                dest: 'images_build/spritesheet.png',
                destCss: 'css/sprites.css'
            }
        },

        connect: {
            server: {
                options: {
                    port: 9001,
                    base: {
                        path: 'www-root',
                        options: {
                            index: 'back_call/index.html',
                            maxAge: 300000
                        }
                    }
                }
            }
        },
        watch: { //отслеживание изменений
            // opt  ions: { livereload: true },
            // scripts: {
            //     files: ['js/*.js'],
            //     tasks: ['concat', 'uglify'],
            //     options: {
            //         spawn: false
            //     }
            // },
            css: {
                files: ['css/*.scss'],
                tasks: ['sass'],
                options: {
                    spawn: false
                }
            },
            sprites: {
                files: ['sprites/*.{png,jpg}'],
                tasks: ['sprite'],
                options: {
                    spawn: false
                }
            }
        }
    });
    // 3. Тут мы указываем Grunt, что хотим использовать этот плагин
    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-imagemagick');
    grunt.loadNpmTasks('grunt-spritesmith');
    // grunt.loadNpmTasks('grunt-contrib-connect');
    // 4. Указываем, какие задачи выполняются, когда мы вводим «grunt» в терминале
    grunt.registerTask('default', ['watch']);
    // grunt.registerTask('default', ['concat', 'uglify', 'imagemin', 'sprite'], 'connect');
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2015-04-15
@k12th

Well, if you correct the typos in your question, here's what you can google: https://github.com/Ensighten/grunt-spritesmith/iss...

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question