如何在grunt中启动快速服务器?

时间:2016-06-11 03:17:59

标签: angularjs grunt-contrib-connect

我用Yeoman生成了我的角度1.0应用程序。 gruntfile不包含快速服务器配置:

connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },

如何为其添加快速服务器配置?我可以用grunt-contrib-connect做到这一点吗?

1 个答案:

答案 0 :(得分:1)

您可以使用" grunt-express-server" https://www.npmjs.com/package/grunt-express-server。我不知道你是否可以使用" grunt-contrib-connect"对此。

相关问题