【问题标题】:"undefined is not a function" grunt less“未定义不是函数”咕噜声更少
【发布时间】:2015-06-02 07:29:34
【问题描述】:

下午好,尝试处理程序集,但得到错误:

“未定义不是函数”

我的文件夹结构: -/较少的 无风格 - /成分 header.less -/css -/img -/js

我安装了:grunt-contrib-less 还有我的文件:

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']);
};

我在 style.less 中写道:@import "components/page-header.less";

告诉我我的错误是什么?

【问题讨论】:

  • 代码的哪一行抛出了错误?
  • 当我运行 grunt 时,Loading Gruntfile.js 任务错误
  • 它不会告诉你代码的哪一行?

标签: css gruntjs less grunt-contrib-less


【解决方案1】:

最后一行应该是(registerTask 没有尾随 s):

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-11
    相关资源
    最近更新 更多