5

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

これを理解するのに役立つ支援は大歓迎です:)

4

1 に答える 1