rollup.js

rollup.js

rollup.js the next-generation ES6 module bundler.

Make sure you’ve already set up the assets module in your project!

dependency

<dependency>
 <groupId>org.jooby</groupId>
 <artifactId>jooby-rollup.js</artifactId>
 <version>1.6.6</version>
 <scope>provided</scope>
</dependency>

usage

assets {
  fileset {
    home: ...
  }

  pipeline {
    ...
    dev: [rollup]
    dist: [rollup]
  }

}

options

generate

rollup {
    genereate {
      format: es
    }
  }

See generate options.

plugins

babel
rollup {
    plugins {
      babel {
        presets: [[es2015, {modules: false}]]
      }
    }
  }

See https://babeljs.io for more options.

legacy

This plugins add a export default line to legacy modules:

rollup {
    plugins {
      legacy {
        "/js/lib/react.js": React
      }
    }
  }

alias

Set an alias to a common (probably long) path.

rollup {
    plugins {
      alias {
        "/js/lib/react.js": "react"
      }
    }
  }

Instead of:

import React from 'js/lib/react.js';

Now, you can import a module like:

import React from 'react';

see also

css processors

js processors

  • props: replace application properties in JavaScript files.

  • jscs: JavaScript code style checker.

  • jshint: JavaScript linter, helps to detect errors and potential problems in code..

  • babel: Ecma6 now via Babel.

  • rollup: rollup.js the next-generation ES6 module bundler.

  • ng-annotate: Add, remove and rebuild AngularJS dependency injection annotations.

  • closure-compiler: Google JavaScript optimizer and minifier.

  • uglify: uglify.js optimizer.

  • replace: replace strings in files while bundling them.

  • requirejs: r.js optimizer.

  • yui-js: YUI JS optimizer.