instantaneous asset reload without nginx
parent
e5880aba38
commit
fc8891af28
|
@ -46,6 +46,10 @@ final class LilaComponents(ctx: ApplicationLoader.Context)
|
|||
implicit def system = actorSystem
|
||||
implicit def ws = wsClient
|
||||
|
||||
// dev assets
|
||||
implicit def mimeTypes = fileMimeTypes
|
||||
lazy val devAssetsController = wire[ExternalAssets]
|
||||
|
||||
lazy val boot: lila.app.EnvBoot = wire[lila.app.EnvBoot]
|
||||
lazy val env: lila.app.Env = boot.env
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import views._
|
|||
final class Main(
|
||||
env: Env,
|
||||
prismicC: Prismic,
|
||||
assetsC: Assets
|
||||
assetsC: ExternalAssets
|
||||
) extends LilaController(env) {
|
||||
|
||||
private lazy val blindForm = Form(
|
||||
|
@ -188,5 +188,5 @@ Disallow: /games/export
|
|||
}.fuccess
|
||||
}
|
||||
|
||||
def devAsset(@silent v: String, file: String) = assetsC.at(file)
|
||||
def devAsset(@silent v: String, path: String, file: String) = assetsC.at(path, file)
|
||||
}
|
||||
|
|
|
@ -23,8 +23,10 @@ PlayKeys.playDefaultPort := 9663
|
|||
PlayKeys.externalizeResources := false
|
||||
// shorter prod classpath
|
||||
scriptClasspath := Seq("*")
|
||||
// give a fake assets dir to make sure they're not packaged
|
||||
resourceDirectory in Assets := baseDirectory.value / "public-nothanks"
|
||||
// don't make an assets jar
|
||||
/* resourceDirectory in Assets := (sourceDirectory in Compile).value / "assets" */
|
||||
PlayKeys.generateAssetsJar := false
|
||||
// use akka-http for dev
|
||||
PlayKeys.devSettings += "play.server.provider" -> "play.core.server.AkkaHttpServerProvider"
|
||||
|
||||
|
|
|
@ -602,8 +602,8 @@ POST /jsmon/:event controllers.Main.jsmon(event: String)
|
|||
|
||||
GET /swag controllers.Main.movedPermanently(to: String = "https://shop.spreadshirt.com/lichess-org")
|
||||
|
||||
GET /assets/_$v<\w{6}>/*file controllers.Main.devAsset(v, file)
|
||||
GET /assets/*file controllers.Assets.at(file)
|
||||
GET /assets/_$v<\w{6}>/*file controllers.Main.devAsset(v, path="public", file)
|
||||
GET /assets/*file controllers.ExternalAssets.at(path="public", file)
|
||||
|
||||
GET /robots.txt controllers.Main.robots
|
||||
|
||||
|
|
Loading…
Reference in New Issue