localhost:9000在播放框架中占用太多时间

时间:2017-08-02 13:46:18

标签: linux playframework playframework-2.4

我正在使用游戏2.4我的播放应用程序工作正常然后我需要在安装这些组件后安装一些UI组件,如graunt bower ruby compassactivator run之后reload clean compile并点击localhost:9000加载页面需要将近半小时或更长时间,而在控制台上除了

之外什么也没有
--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

我已经在这个主题的堆栈上查看了其他答案,但没有一个对我有用,请帮助

1 个答案:

答案 0 :(得分:0)

  

请确保您的公用文件夹资料或node_modules不是   正在编译,因为如果他们将与您的应用程序编译   你会一直被困住。

您也可以按照以下步骤操作 - >

> stop play
> delete folder where your code compiles. There will be also a node_module folder that will be taking time too much. 
> Again compile it with clean, but make sure in your compiled file, node modules folder is not being compiled.
  

build.sbt 中,(这只是一种做这些事情的方法,语法可能会在不同版本的播放框架中发生变化)

import play.sbt.PlayImport.PlayKeys.playRunHooks

lazy val gulpDirectory = baseDirectory {
    _ / "admin-panel"
}

excludeFilter := HiddenFileFilter -- ".tmp"

unmanagedResourceDirectories in Assets <+= gulpDirectory { _ / "dist"}

unmanagedResourceDirectories in Assets <+= gulpDirectory { _ / ".tmp"}

unmanagedResourceDirectories in Assets <+= gulpDirectory { _ / "bower_components"}

//this is for development environment
unmanagedResourceDirectories in Assets <+= gulpDirectory { _ / "src" / "app"}

playRunHooks <+= gulpDirectory.map(path => Gulp(path))
  

如果这不起作用,我们也可以试试。

mappings in (Compile, packageBin) ~= { _.filterNot { case (_, name) =>
      name.startsWith("public\\node_modules")
}}

您也可以访问链接

  

https://www.playframework.com/documentation/2.4.x/SBTCookbook