0

I am using play 2.4 My play app was working fine then I needed to install some UI components like graunt bower ruby compass after installing these components when i do activator run after reload clean compile and hit localhost:9000 it takes almost half hour or more to load the page and on the console there is nothing except

--- (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...)

I have looked into other answers on stack for this topic but none of them worked for me please help

swaheed
  • 3,671
  • 10
  • 42
  • 103

1 Answers1

0

please make sure your public folder stuff or node_modules are not being compiled, because if they will compile with ur application you'll be stuck like that always.

steps you can also follow ->

> 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.

In build.sbt, (This is just a way to do these stuff, the syntax might change in different version of 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))

If this is not working, we can try this as well.

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

you can also visit the link

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

Ashish Ratan
  • 2,838
  • 1
  • 24
  • 50
  • i am getting an error [error] Type error in expression Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r [info] Loading project definition from /home/sara/git/arteciate/project /home/build.sbt:106: error: not found: value Gulp playRunHooks <+= gulpDirectory.map(path => Gulp(path)) – swaheed Aug 04 '17 at 09:35
  • https://stackoverflow.com/questions/32000681/include-exclude-asset-folder-directory-in-sbt-play-framework/37356485 , refer this link if helps – Ashish Ratan Aug 04 '17 at 09:50