sbt-web

How can scala-js integrate with sbt-web?

时间秒杀一切 提交于 2020-01-01 05:33:07
问题 I would like to use scala-js with sbt-web in such a way that it can be compiled to produce javascript assets that are added to the asset pipeline (e.g. gzip, digest). I am aware of lihaoyi's workbench project but I do not believe this affects the asset pipeline. How can these two projects be integrated as an sbt-web plugin? 回答1: Scala-js produces js files from Scala files. The sbt-web documentation calls this a Source file task. The result would look something like this: val

Play Framework sbt-web integration without play plugin

家住魔仙堡 提交于 2019-12-13 06:12:36
问题 Embedding play as a library, I enabled the sbt-web plugin in my project, and have run web-stage , making assets copied verbatim to target/web/stage/ . However using Play Framework's string interpolation routing DSL as follows, they are not served when a matching request comes in: object PlayServer extends App { val server = NettyServer.fromRouter() { case GET(p"/public/$file*") => { val path = "/target/web/stage" Assets.at(path = path, file = file) } } Debugging through the play code handling

Play 2.4.x - Assets duplication

穿精又带淫゛_ 提交于 2019-12-11 13:58:09
问题 In a Play 2.4.6 app I'm working on the assets are being duplicated in stage/dist tasks. Basically it is a app with 3 submodules, with all the assets present in the main public folder. I don't have sbt-web enabled and have no webjars dependencies (but from the jar contents Play may be using them somewhere). If I use PlayKeys.externalizeResources := false I end up with two jar files in the lib folder: myapp-server.myapp-server-0.9.6-assets.jar myapp-server.myapp-server-0.9.6.jar The first one

Get assets to compile when running via “activator run” in Play

两盒软妹~` 提交于 2019-12-10 17:56:43
问题 I am using Sass as my CSS preprocesser, and I'm trying to have it run via the asset pipeline. I've tried implementing this sassTask as a source file task and as a web asset task, but I'm running into problems both ways. If I run Sass as a source task (see below), it gets triggered during activator run when a page is requested and updated files are found upon page reloads. The problem I'm running into is that the resulting CSS files are all getting dumped directly into target/web/public/main

How can sbt-web output be used with xsbt-web-plugin via a SBT project dependency?

我的未来我决定 提交于 2019-12-09 07:44:29
问题 I am trying to use the sbt-web plugin without the play framework and instead build a webapp using the xsbt-web-plugin. I have gotten the sbt-web plugin working correctly in handling the asset pipeline and have it creating a valid webjar output (via packageBin) as well as the standard "web/public/main" output (via assets). Separately, I have been using the xsbt-web-plugin to develop a webapp and serve that webapp from within SBT (via container:start). The webapp project can consume webjar

Play 2.3 requireJs optimization and shim for multiple modules

北慕城南 提交于 2019-12-07 07:22:26
问题 This is my current setup for Play 2.2.x requireJS. Will it continue to work after 2.3? I can't find requireJs or requireJsShim anywhere in the 2.3 documentation. requireJs ++= Seq("mainAccount.js", "mainOrg.js", "mainPublic.js"), // This tells Play to optimize this file and its dependencies requireJsShim += "build.js", // This tells Play to read the RequireJS "shim" configuration from build.js requireJsFolder := "js" 回答1: Instead of requireJs use: RjsKeys.modules := Seq( WebJs.JS.Object("name

Play 2.3 requireJs optimization and shim for multiple modules

依然范特西╮ 提交于 2019-12-05 12:40:59
This is my current setup for Play 2.2.x requireJS. Will it continue to work after 2.3? I can't find requireJs or requireJsShim anywhere in the 2.3 documentation. requireJs ++= Seq("mainAccount.js", "mainOrg.js", "mainPublic.js"), // This tells Play to optimize this file and its dependencies requireJsShim += "build.js", // This tells Play to read the RequireJS "shim" configuration from build.js requireJsFolder := "js" Instead of requireJs use: RjsKeys.modules := Seq( WebJs.JS.Object("name" -> "mainAccount"), WebJs.JS.Object("name" -> "mainOrg"), WebJs.JS.Object("name" -> "mainPublic") ) Instead

How can scala-js integrate with sbt-web?

本秂侑毒 提交于 2019-12-03 15:21:41
I would like to use scala-js with sbt-web in such a way that it can be compiled to produce javascript assets that are added to the asset pipeline (e.g. gzip, digest). I am aware of lihaoyi's workbench project but I do not believe this affects the asset pipeline. How can these two projects be integrated as an sbt-web plugin? Scala-js produces js files from Scala files. The sbt-web documentation calls this a Source file task . The result would look something like this: val compileWithScalaJs = taskKey[Seq[File]]("Compiles with Scala js") compileWithScalaJs := { // call the correct compilation