Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uglifyOps usage example #18

Open
loicdescotte opened this issue Mar 16, 2016 · 2 comments
Open

uglifyOps usage example #18

loicdescotte opened this issue Mar 16, 2016 · 2 comments

Comments

@loicdescotte
Copy link

Hi,

It would be good to add an example of uglifyOps usage in the README.
The definiton is quite complex (SettingKey[(Seq[(File, String)]) => Seq[(Seq[(File, String)], String)]]) and not sufficient to understand the usage.

Thanks

@dpennell
Copy link

You need to supply a function that partitions a standard sbt mapping seq (Seq[(File, String)] into groups or layers. A convenient way to do this is to create a method in e.g. project/Layers.scala:

object Layers {
  def mapToLayers(inMappings: Seq[File, String]): Seq[(Seq[(File, String), String)] = {
   ....
  }
}

and then in build.sbt,

.settings(uglifyOps = Layers.mapToLayers)

The String field that groups mappings is actually a relative path name. So you probably want to use something like "javascript/Layer1.js". This file will contain all files listed for that group concatenated and uglified. It will have a companion file with .map appended to the name.

@marcialca
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants