grunt-contrib-connect错误:中间件未定义

时间:2015-08-19 16:46:55

标签: gruntjs grunt-contrib-connect

我正在为我的AngularJS应用程序使用yeoman的角度生成器。这个生成器包括grunt和grunt-contrib-connect,它们非常有用......但是依赖项已经过时了,所以我决定更新它们。

这样做时,grunt-contrib-connect出错了,这是我使用--verbose选项的时候:

Running "connect:test" (connect) task
Verifying property connect.test exists in config...OK
File: [no files]
Options: protocol="http", port=9001, hostname="localhost", base=".", directory=null, 
keepalive=false, debug=false, livereload=35729, open=false, useAvailablePort=false, 
onCreateServer=null, middleware=undefined
Warning: undefined is not a function Use --force to continue.

Aborted due to warnings.

所以似乎中间件负责这个问题,这里是:

middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }

任何帮助我解决这个问题的帮助都非常受欢迎:)

1 个答案:

答案 0 :(得分:0)

使用grunt-contrib-connect版本0.10.1似乎为我解决了这个问题。 Issue 161可能是相关的。

相关问题