Skip to content

How to Exclude *.min.js Files #11

@mslinn

Description

@mslinn

I'd like to combine multiple unminified .js files, then minify the combined file and place it in the webapps's public/js/main.min.js. I also want to ignore all WebJars JavaScript because those files are already minified.

I tried this:

pipelineStages := Seq(rjs, uglify, digest, gzip)

UglifyKeys.uglifyOps := { js =>
  Seq((js.sortBy(_._2), "main.min.js"))
}

However all .js files, including previously minified .js files, were combined, which takes forever.

I then tried adding this:

excludeFilter in uglify := GlobFilter("*.min.js")

But main.min.js now just contains:

define("main",function(){});
//# sourceMappingURL=main.js.map

Once I get this test project working, I will try it on my production app, which has dozens of JS files in various subdirectories under public/. Hopefully the solution won't require a manual listing of every .js file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions