Gruntjs “装载”;gruntfile.js“;任务…错误>&燃气轮机;ReferenceError:未定义grunt
我的代码中有一个问题 我在concole中写道:grunt connect 这是错误消息: 正在加载“gruntfile.js”任务…错误 ReferenceError:未定义grunt 警告:未找到任务“连接”。使用--force继续 由于警告而中止Gruntjs “装载”;gruntfile.js“;任务…错误>&燃气轮机;ReferenceError:未定义grunt,gruntjs,Gruntjs,我的代码中有一个问题 我在concole中写道:grunt connect 这是错误消息: 正在加载“gruntfile.js”任务…错误 ReferenceError:未定义grunt 警告:未找到任务“连接”。使用--force继续 由于警告而中止 这是我的gruntfile.js文件: 我的代码中有什么问题? 为什么找不到连接任务?“每个Gruntfile(和gruntplugin)都使用此基本格式,并且必须在此函数中指定所有Grunt代码:”- 移动grunt.loadNpmTas
这是我的gruntfile.js文件:
我的代码中有什么问题? 为什么找不到连接任务?“每个Gruntfile(和gruntplugin)都使用此基本格式,并且必须在此函数中指定所有Grunt代码:”- 移动
grunt.loadNpmTasks('grunt-contrib-connect')此函数中的code>应该可以解决此问题。每个GrunFile(和gruntplugin)都使用此基本格式,并且必须在此函数中指定所有Grunt代码:-
移动grunt.loadNpmTasks('grunt-contrib-connect')代码>此函数内部应该会修复它。是的,我刚刚注意到:)谢谢您的快速回答!:)是的,我刚刚注意到:)谢谢你的快速回答!:)
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
uses_defaults: {}
}
});
// Load Grunt plugins
grunt.loadNpmTasks('');
// Default task(s).
grunt.registerTask('default', []);
};
// Load Grunt plugins
grunt.loadNpmTasks('grunt-contrib-connect');
module.exports = function(grunt) {
// Do grunt-related things in here
};