【问题标题】:localhost:9000 takes too much time load in play frameworklocalhost:9000 在播放框架中需要太多时间加载
【发布时间】:2017-08-02 13:46:18
【问题描述】:

我正在使用 play 2.4 我的 play 应用程序运行良好,然后我需要安装一些 UI 组件,例如 graunt bower ruby compass 在安装这些组件之后,当我在 activator 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...)

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

【问题讨论】:

  • 如果有什么不对的地方也请在这里留言,谢谢,我会问我的错误
  • 是的,你肯定会做错的。我会帮忙的
  • 如果您对此问题有所了解,请告诉我,谢谢

标签: linux playframework playframework-2.4


【解决方案1】:

请确保您的公用文件夹内容或 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中,(这只是做这些东西的一种方式,不同版本的play framework语法可能会有所不同)

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

【讨论】:

  • 我收到错误 [错误] 表达式中的类型错误项目加载失败:(r)etry、(q)uit、(l)ast 或 (i)gnore? r [info] 从 /home/sara/git/arteciate/project /home/build.sbt:106 加载项目定义:错误:未找到:值 Gulp playRunHooks Gulp(path))
  • stackoverflow.com/questions/32000681/… ,如果有帮助请参考此链接
猜你喜欢
  • 2011-06-03
  • 2017-04-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-06
  • 1970-01-01
  • 2020-05-15
相关资源
最近更新 更多