Skip to content
algesten edited this page Nov 24, 2010 · 13 revisions

For the impatient.

Get the jar

Using maven

<dependencies>
  ...
  <dependency>
    <groupId>foodev</groupId>
    <artifactId>fnug</artifactId>
    <version>0.24</version>
  </dependency>
 ...
</dependencies>

<repositories>
 ...
  <repository>
    <id>algesten</id>
    <url>http://algesten.github.com/maven2</url>
  </repository>
 ...
</repositories>

By hand

Download it from here: http://algesten.github.com/maven2/releases/foodev/fnug/

Configure the bundle (example using maven)

Config files and resources MUST be on the classpath

File layout src/main/resources/bundles.js <-- config file src/main/resources/js/ src/main/resources/js/mypackage/ src/main/resources/js/mypackage/sourcefile.js src/main/resources/js/mypackage/sourcefile.css ... src/main/webapp/WEB-INF/web.xml <-- servlet pointing to config src/main/webapp/index.html <-- loads js/css bundle

bundles.js { mypackage: { basePath: '/js/' <-- base path of mypackage from classpath root. files: [ 'mypackage/sourcefile.js' <-- array of "entry" files for dependency resolution. ], // Optional JsLint string. // jsLint: '/*jslint white: true, browser: true, onevar: false, undef: true, nomen: true, eqeqeq: true, plusplus: false, bitwise: true, regexp: true, newcap: true, immed: true, maxerr: 100, maxlen: 100 */', // Optional check modified interval (ms). Defaults to 3000. // checkModified: 3000, // turn off by default } }

web.xml fnug fnug.ResourceServlet 1 config /bundles.js <-- points to config file from classpath root. fnug /rs/*

index.html

<script type="text/javascript" src="/rs/mypackage.js"></script> <-- loads all bundle dependencies (and css).

Clone this wiki locally