Code Monkey home page Code Monkey logo

sbt-filter's Introduction

sbt-filter

sbt-web plugin that filters intermediate assets on the asset pipeline.

This plugin may be used to remove any intermediate or unnecessary assets from the product build of your project. Only assets directly owned by the project can be filtered. Any assets living in the "lib" subdirectory are explicitly left unfiltered.

Add the plugin to the project/plugins.sbt of your project:

addSbtPlugin("com.slidingautonomy.sbt" % "sbt-filter" % "1.0.1")

Your project's build file also needs to enable sbt-web plugins. For example with build.sbt:

lazy val root = (project in file(".")).enablePlugins(SbtWeb)

The plugin must then be added as a new stage in the asset pipeline.

pipelineStages := Seq(filter)

File Filters

By default, the plugin allows all assets to pass through the pipeline. To filter assets, you must explicitly configure the includeFilter and excludeFilter to match your requirements.

Any asset matched by the includeFilter will be filtered from the build, unless it also matches the exclude filter. Because filtering is a negative action, the sense of the includeFilter and excludeFilter may seem reversed. Remember that the includeFilter selects assets to be filtered while the excludeFilter removes assets from the list of assets that will be filtered.

For example, to remove the original CoffeeScript and LESS sources from the assets build:

includeFilter in filter := "*.coffee" || "*.less"

Alternatively, you may wish to remove all JavaScript files except the concatenated and minified main.js produce by the RequireJS plugin:

includeFilter in filter := "*.js"

excludeFilter in filter := "main.js"

sbt-filter's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.