Gruntfile.js
module.exports = functions(grunt)
{
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';',
},
dist: {
src: ['APIdocu/AccountsCollection.md', 'APIdocu/AccountsFollowersCollection.md'],
dest: 'APIdocu/ConcatApis.md',
//files: {
//'APIdocu/NewApi.md' : ['APIdocu/AccountsCollection.md', 'APIdocu/AccountsFollowersCollection.md']
},
},
});
grunt.loadNpmTasks('grunt-contrib-concat');
//tasks
grunt.registerTask('default', ["concat"]);
}
错误消息
Initializing
Command-line options: --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Loading "Gruntfile.js" tasks...ERROR
ReferenceError: grunt is not defined
at Object.<anonymous> (C:Usersgs1460DesktopMarkdownfilesapisGruntfile.js:1:90)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at loadTask (C:Usersgs1460DesktopMarkdownfilesapisnode_modulesgruntlibgrunttask.js:323:10)
at Task.task.init (C:Usersgs1460DesktopMarkdownfilesapisnode_modulesgruntlibgrunttask.js:437:5)
at Object.grunt.tasks (C:Usersgs1460DesktopMarkdownfilesapisnode_modulesgruntlibgrunt.js:120:8)
at Object.module.exports [as cli] (C:Usersgs1460DesktopMarkdownfilesapisnode_modulesgruntlibgruntcli.js:38:9)
Running tasks: concat:dist
Warning: Task "concat:dist" not found. Use --force to continue.
Aborted due to warnings.
我该如何消除这个错误。我需要将md文件连接到一个。它给了我上述错误。尝试多次更改代码。但同样的问题。你能帮忙吗。
问题可能是您编写的是functions
而不是function
。还要检查可变咕哝声是否在正确的范围内。请正确使用标签!
module.exports = function(grunt)
谨致问候。