【发布时间】:2014-08-27 00:05:08
【问题描述】:
我是 Grunt 的新手。每当我运行 Grunt 命令时,它都会发出此警告并中止。警告如下。
正在加载“Gruntfile.js”任务...错误
TypeError: Object # has no method 'loadNpmtasks' 警告:找不到任务“默认”。使用 --force 继续。
由于警告而中止。
我知道以前有人问过这类问题。我已经看到了那些答案。它们都有一些语法错误。我在我的里面找不到任何东西。下面给出了我的代码。
module.exports = function(grunt){
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
concat : {
dist : {
src : [
'something.js',
'anything.js'
], dest : 'new.js'
}
}
});
grunt.loadNpmtasks('grunt-contrib-concat');
grunt.registertasks('default', ['concat']);
};
【问题讨论】:
标签: javascript gruntjs grunt-contrib-concat