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 sbt-concat. I tried sbt-closure for js, but it does not seem to work. Just to be clear, I tried sbt-closure and it is confirmed that it does compilation of all js below to /assets. However I am trying to figure out if it works with sbt-concat.
For example: if I have /assets/js/f1.js and /assets/js/f2.js and I would like to combine them and minify into 1 bundle file.
You can use sbt-uglify to combine and minify.
Add to
plugins.sbt
:Add to
build.sbt
:This will combine your javascript sources alphabetically by their file path.
Use
pipelineStages in Assets
if you want to concat/uglify in development. Normally it would only execute for a production build.