"undefined is not a function" grunt less

477 Views Asked by At

Good afternoon , trying to deal with the assembly , but get the error:

"undefined is not a function"

My folder structure: -/less style.less --/components header.less -/css -/img -/js

I installed : grunt-contrib-less and that my file:

module.exports = function(grunt) {
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    less: {
        development: {
            options: {
                paths: ["less"]
            },
            files: {
                "css/style.css": "less/style.less"
            }
        }
    },
});

grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTasks('default',['less']);
};

in style.less I wrote: @import "components/page-header.less";

tell me what my mistake?

1

There are 1 best solutions below

0
On

Last line should be (no trailing s for registerTask):

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