JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20858
  • Score
    100M100P100Q138899F
  • License MIT

Browserify transform that compiles es2015 to es5 using Bublé

Package Exports

  • bubleify

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bubleify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bubléify build status Coverage Status

A browserify transform for Bublé to transform ES2015 to ES5.

Installation

npm install --save-dev bubleify

Usage

Node

const browserify = require('browserify');
const bubleify = require('bubleify');

const b = browserify();
b.add('./file.es2015.js'));
b.transform(bubleify, {
  target: {
    chrome: 48,
    firefox: 44,
  },
  transforms: {
    arrow: true,
    defaultParameter: false,
    dangerousForOf: true,
  },
});
b.bundle();

CLI

browserify script.js -o bundle.js -t [ bubleify ]

Options

target: Object

Target specifies a list of environments the output file should be compatible to. Bublè will decide based on this list which transforms should be used.

transforms: Object

Transforms define which ES2015 features should or should not be transformed into ES5.

Bublèify by default disables the module transform to not throw an error when ES2015 import and export statements are used. If you want to use ES2015 modules you should add another transform to do so.

Find a list of all transforms on the Bublè documentation in section list of transforms. For more detailed information about each transform also see supported features and dangerous transforms.

sourceMap: Boolean

Define whether an inline source map should or should not be created by Bublé. Default is true.

Please note that browserify will not output any source map if debug mode is false, even if sourceMap was set to true.

Credits

Thanks goes to Rich Harris for the Bublè package.

License

Licensed under the MIT License.