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
4
votes
2 answers

How do I get sbt-web working in Build.scala?

I have a fairly complex project -- it's using Play, Scala.js and various other toys. It's built in Build.scala for the time being, because I haven't managed to get all the parts working in build.sbt yet. (I've talked about this separately on the sbt…
Justin du Coeur
  • 2,539
  • 1
  • 12
  • 19
4
votes
1 answer

Can't get sbt-mocha to see Angular webjar mocks library properly

I can't get Angular mocks or angular itself to be recognized in an sbt-web / sbt-mocha project. I was writing a sample based on the sbt-web play http://typesafe.com/activator/template/play-2.3-highlights highlights sample. I killed the other…
Ken Rimple
  • 126
  • 6
4
votes
1 answer

Sbt-concat support multiple bundle?

I am using sbt-concat to create bundles for JS in my application. However, it does not seem to support creating multiple bundles. In my application, I would like to create a base level js for global use. Then I also want to create a components…
JMC
  • 363
  • 1
  • 11
4
votes
1 answer

Play 2.3 requireJs optimization and shim for multiple modules

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…
angelokh
  • 9,394
  • 6
  • 61
  • 119
3
votes
0 answers

Using npm within a Play application

From the Play 2.3 Migration Guide: npm can be used as well as WebJars by declaring a package.json file in the root of your project. Assets from npm packages are extracted into the same lib folder as WebJars so that, from a code perspective, there…
lefloh
  • 9,828
  • 3
  • 24
  • 46
3
votes
1 answer

Why should I use front-end plugins with my sbt playframework project?

If I have an angularjs frontend and am using play in the backend, why do people use the various sbt-plugins? I understand how to use them, to compile the frontend etc. but isn't it better just to seperate the 2 projects completely and just use the…
Blankman
  • 236,778
  • 296
  • 715
  • 1,125
3
votes
3 answers

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

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…
Martin Snyder
  • 468
  • 3
  • 12
3
votes
0 answers

Play2.3 does not combine non-webjar javascript files into the main RequireJS uglified file

After upgrade to Play 2.3, requirejs is able to bundle and unglify all paths into the one main file ONLY if the path's come from a webjar. Ie. if the config section of my require loos like this paths: { bacon: '../lib/baconjs/Bacon.min', //…
2
votes
0 answers

How can I have my Angular2 TestAssets in the same directory as my Assets with Play Framework?

Angular2 has moved to a more modular approach to a projects sources. That means that all of a submodules sources, html templates and tests are together in one directory. Instead of spread across an app, public and test directory. It's an approach…
Joost de Vries
  • 602
  • 6
  • 8
2
votes
0 answers

How to get SBT to recognize a setting for a custom config scope

I'm using sbt-web, and I'd like to only uglify js files for production (saves compile time while developing). However, when I run: sbt prod:run I get the same result as sbt run That is, prod:run doesn't seem to pickup the pipelineStages in prod…
l p
  • 500
  • 6
  • 16
2
votes
1 answer

Minimal sbt-web pipeline without Play

I'm using spray to create a single page app, and cannot get sbt-web to process any of my inputs. I started with WebJars, because, https://github.com/sbt/sbt-web/blob/master/README.md says: One last thing regarding the public and public-test…
l p
  • 500
  • 6
  • 16
2
votes
0 answers

sbt-concat doesn't create groups for files in subfolders

i'm trying to create a concat group using sbt-concat in a play framework project (v2.3.8). But it doesn't work. The files in the /app/assets/ folder are concatenated successfully but any group incorporating files in subfolders doesn't work. In the…
atp
  • 21
  • 2
2
votes
1 answer

How to reference exported assets in a multi-module play project

I have a multi-module Play Framework project with two modules, common which is a standard project containing reusable code and assets, and app which is the play project I am trying to run. Using the Sbt-Web plugin, I am able to create and modify…
medtechguy
  • 75
  • 7
2
votes
0 answers

Using wildcards in sbt-concat in play framework 2

I have question concerning the integration of sbt-concat in play framework 2. I'm using sbt-concat 0.1.8 The file that I want to concatenate are in "javascripts/libs/jquery/jquery-ui/theme/smoothness/jquery-ui.css" Here is my build.sbt name :=…
Molochdaa
  • 1,958
  • 1
  • 16
  • 23
2
votes
2 answers

how to minify js produced by sbt-concat

I was doing my experiments using sbt-concat to combine css/js bundles. I then tried to expand my pipeline in order to do minify for my css and js. It is fairly easy to use sbt-css-compress which does minification of all the CSS produced by…
JMC
  • 363
  • 1
  • 11