How to use grunt serve in Cloud9 IDE?

后端 未结 3 1715
悲&欢浪女
悲&欢浪女 2020-12-30 08:49

In my Gruntfile.js I have tried to do this:

connect: {
  options: {
    port: process.env.PORT,
    hostname: process.env.IP,
    livereload: 35729
  }
}
         


        
3条回答
  •  感动是毒
    2020-12-30 09:09

    You can use any port, when it is used for local/loopback connections. From outside your workspace only one port is accessible (at this moment that is, C9 is considering multiple ports). I'm not too familiar with this livereload, sorry. It seems that grunt needs to spawn a browser as well? That will not run on C9.

    But why would you not use the 'live preview' that Cloud9 provides? Just open any html page, click Preview and select 'Live preview'. All changes to css, html will be applied immediately in the preview frame.

提交回复
热议问题