Package detail

gobble-esperanto-bundle

gobblejs32MIT0.2.1

Bundle ES6 modules with gobble and esperanto

gobble, gobble-plugin

readme

gobble-esperanto-bundle

Bundle ES6 modules with gobble and esperanto.

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm i -D gobble-esperanto-bundle

Usage

gobblefile.js

var gobble = require( 'gobble' );
module.exports = gobble( 'src' ).transform( 'esperanto-bundle', {
  entry: 'app.js' // you must specify an entry module. The '.js' is optional
});

This will create a single AMD module file that contains app.js and all its dependencies (and their dependencies, and so on) that Esperanto finds in src. By default it will also be called app.js - you can change it to something else with the dest option.

Additional options

You can specify a type of module:

  • type: 'amd' (the default) - Asynchronous Module Definition, used by RequireJS and its ilk
  • type: 'cjs' - CommonJS, for use in node or with Browserify
  • type: 'umd' - Universal Module Definition. Works as AMD, CommonJS, or browser global. You must supply a name option for the global export.

Sourcemaps are generated by default. If you don't want to create a sourcemap, pass sourceMap: false, or pass sourceMap: 'inline' to append the sourcemap to the bundle as a data URI.

For strict mode output, pass strict: true.

License

MIT. Copyright 2014 Rich Harris

changelog

changelog

0.2.1

  • Update to sander 0.3.4

0.2.0

  • Update to esperanto 0.7.0

0.1.7

  • Update to esperanto 0.6.11, which supports bundling external ES6 modules

0.1.6

  • Use absolute path for options.sourceMapFile

0.1.5

  • Add concat support

0.1.4

  • Update to esperanto 0.6.0

0.1.2

  • Create sourcemaps by default

0.1.1

  • Sourcemap support

0.1.0

  • Initial release