sbt-play-gulp
sbt-play-gulp copied to clipboard
Packaged project does not serve static index.html
I have a project which is similar to the react sample. When I run in activator, it works. I have index.html in ui/app
. When I ran activator universal:packageBin
to create a distribution, the resulting distribution did not serve index.html.
When I added
unmanagedResourceDirectories in Assets <+= (gulpDirectory in Compile)(base => base / "app" )
to build.sbt, it would serve index.html, but as an attachment, so the browser asked me where I wanted to save the file, rather than displaying it.
This appears to be related to the switch from dev mode to prod mode.
When I moved index.html to app/views/index.scala.html, added
GET /ui/index.html controllers.HomeController.index()
to routes and implemented the method to return ok(views.html.index.render())
, it I could load index.html when I accessed server:9000/, but it could not then load the javascript from the ui directory.
Are there simple directions for making the plugin work in production mode?