Questions tagged [sbt-web]

sbt-web is a plugin for Scala's SBT build system, which provides a build pipeline for client-side assets, allowing SBT to be a full-stack build tool for Scala web applications.

sbt-web provides features useful for building client-side web assets, including source file generation, an asset transformation pipeline (e.g. for minfication, gzip compression), incremental compilation, NPM compatibility, and Javascript execution engines.

While closely aligned with the Play Framework, sbt-web is compatible with any project that uses SBT for its builds. The related Webjars project allows client-side library resources to be included in the Scala build process.

58 questions
74
votes
1 answer

Optimizing JS from WebJars using sbt-rjs in a Play 2.3.x app

Is it possible to have a Play 2.3 app concat/optimize JS (using sbt-rjs) that's included in my app via WebJars? To give a concrete example: I'm trying to create a core.js module which contains all my 3rd party libraries concatenated and minified in…
Dylan Hughes
  • 741
  • 4
  • 3
15
votes
1 answer

Browserify/CommonJS with Play Framework

I was wondering how to use CommonJS modules with Play Framework 2.3+ ? I suppose a Browserify plugin can be written in a way similar to sbt-less plugin, but before starting this I want to know how other people are handling this. Is there already a…
sarveshseri
  • 10,459
  • 25
  • 43
12
votes
2 answers

In a ScalaJs sbt build, is there any advantage to use webjars instead of npm or bower with 'Provided'?

When I first discovered webJars a few months ago I was super-skeptical that it would be be a viable way means of handling client-side dependencies given the enormous complexity of some of these builds/buildsystems, and given the frequency that js…
tacos_tacos_tacos
  • 9,687
  • 10
  • 65
  • 116
12
votes
1 answer

Can't get sbt-web to work with npm for frontend dependencies

I'm trying to use sbt-web and sbt-js-engine in particular to resolve my dependencies with npm instead of webjars. My problem is that the dependencies are not copied in the target/web/public/main/lib folder during the web-stage task as it is the case…
ndeverge
  • 20,808
  • 4
  • 54
  • 84
8
votes
1 answer

add sbt-web resources jar to classpath of sbt-native-packager

I have a multi-project build and I'm trying to add the jar with assets generated by sbt-web to the classpath of the launch script The project I'm interested in is called website. typing show website/web-assets:packageBin in sbt creates and shows the…
Martijn
  • 11,183
  • 10
  • 46
  • 92
7
votes
1 answer

Different sbt-web pipeline task settings in development vs production?

I would like an sbt setting to have a different value when running in development (sbt run) than production (sbt dist / sbt start). Specifically I am using sbt-uglify. I use it in development to concatenate javascript assets into one file. I have…
dwickern
  • 3,439
  • 1
  • 12
  • 20
6
votes
1 answer

Cannot get sbt-concat to bundle styles from sbt-sass or sbt-less

(Example project provided) I cannot get sbt-concat to work as designed to find and concatenate stylesheets that result from styles that may be produced from preprocessor tasks. In my production app, I'm trying to use it to bundle select minified…
acjay
  • 28,690
  • 4
  • 51
  • 93
5
votes
0 answers

Trying to use different pipelineStages for prod and dev in sbt-web

I have a project using Play Framework 2.3 and I'm having some issues with how JS files are handled throughout the asset pipeline. I want to process my JS source files differently depending on if the application is started in dev or prod mode.…
Lennholm
  • 6,177
  • 1
  • 15
  • 26
5
votes
1 answer

play 2.3 sbt-concat not working in prod

I want to use this plugin addSbtPlugin("net.ground5hark.sbt" % "sbt-concat" % "0.1.8") To concatenate my assets. I have 3 groups : Concat.groups := Seq( "concat_main.css" -> group(Seq( "stylesheets/bootstrap.min.css", …
Julien D
  • 1,219
  • 9
  • 20
5
votes
0 answers

sbt-rjs: Exclude files from uglification

I'm using sbt-rjs with the sbt-web pipeline to minify and concatenate my javascripts in the the build process. Part of this is uglifying the files which is handled by rjs with the default uglify2 optimiser. My questing is if I can exclude files…
Cristian Vrabie
  • 3,770
  • 5
  • 26
  • 46
5
votes
2 answers

How can scala-js integrate with sbt-web?

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…
Reid Spencer
  • 2,616
  • 25
  • 33
5
votes
1 answer

Get assets to compile when running via "activator run" in Play

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…
acjay
  • 28,690
  • 4
  • 51
  • 93
4
votes
1 answer

Excluding Elm source files from SBT binary distribution

I'm using the Elm integration plugin for Scala/Play projects, known as sbt-elm, in conjunction with Play Framework. I notice that, in addition to the elmMain.js file produced by the elm-make command, all of the .elm source files end up in the…
David
  • 5,074
  • 3
  • 37
  • 64
4
votes
1 answer

Run npm build for play framework within sbt

I'm not very much familiar with sbt/play configuration. I'm using play 2.3.8 to serve my javascript application. In the project there is: .enablePlugins(SbtWeb) .enablePlugins(play.PlayScala) .settings( ... libraryDependencies ++=…
DeBoer
  • 551
  • 1
  • 7
  • 15
4
votes
2 answers

Get resource file from dependency in sbt

I have a sbt-web project with some webjar and common jar dependencies. I want to get resource file from one of my jar dependency and use it in concatenation task. But I don't know how refer to the resource inside dependent jar in my build.sbt.
LMnet
  • 548
  • 1
  • 6
  • 16
1
2 3 4