You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My Play Framework app delivers a number of separate HTML pages to the browser. Rather than download elmMain.js into each of those pages, I would prefer each HTML page to download only the Elm-generated JavaScript that it needs. For example, my ConfigPage.html wants to embed elmConfigPage.js; and my ProjectAdmin.html wants to embed elmProjectAdmin.js.
Can you imagine how I might be able to achieve that with sbt-elm?
Would it require a very significant change to sbt-elm?
The text was updated successfully, but these errors were encountered:
If all of your sources are under single elm project (elm-package.json or elm.json), it's relatively easy to do so.
lazyval`frontend-app1`= project.in(file(".elm/app1"))
.enablePlugins(SbtWeb, SbtElm)
.settings(
name :="frontend-app1",
inConfig(Assets)(Seq(
sourceDirectories in elmMake :=Seq(newFile("elm/App1")),
elmOutput in elmMake := (resourceManaged in elmMake).value /"js"/"App1.js"
)),
(managedClasspath in Runtime) += (packageBin in Assets).value,
publishArtifact in (Compile, packageDoc) :=false,
publishArtifact in packageDoc :=false,
sources in (Compile,doc) :=Seq.empty
)
lazyval`frontend-app2`= project.in(file(".elm/app2"))
.enablePlugins(SbtWeb, SbtElm)
.settings(
name :="frontend-app2",
inConfig(Assets)(Seq(
sourceDirectories in elmMake :=Seq(newFile("elm/App2")),
elmOutput in elmMake := (resourceManaged in elmMake).value /"js"/"App2.js"
)),
(managedClasspath in Runtime) += (packageBin in Assets).value,
publishArtifact in (Compile, packageDoc) :=false,
publishArtifact in packageDoc :=false,
sources in (Compile,doc) :=Seq.empty
)
Idea is to keep elm.json (elm-package.json in case of 0.18) in root directory, sources in elm/ directory, but also have all AppX application sources (including Main module) contained in elm/AppX directory.
It's a bit worse, when you have multiple, independent elm projects (separate elm-package.jsons) as it seems sbt-web doesn't support such case.
My Play Framework app delivers a number of separate HTML pages to the browser. Rather than download
elmMain.js
into each of those pages, I would prefer each HTML page to download only the Elm-generated JavaScript that it needs. For example, myConfigPage.html
wants to embedelmConfigPage.js
; and myProjectAdmin.html
wants to embedelmProjectAdmin.js
.Can you imagine how I might be able to achieve that with sbt-elm?
Would it require a very significant change to sbt-elm?
The text was updated successfully, but these errors were encountered: