bem

broccoli-es6-module-filter

broccoli filter for es6 modules

Showing:

Popularity

Downloads/wk

21

Maintenance

No Maintenance Data Available

Package

Dependencies

3

Size (min+gzip)

50.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

broccoli-es6-module-filter

Build Status

Transpile modules authored in ES6 to other module types.

Installation

npm install --save broccoli-es6-module-filter

Usage (Sample Brocfile.js)

var filterES6Modules = require('broccoli-es6-module-filter');
var pickFiles = require('broccoli-static-compiler');

module.exports = function (broccoli) {

  // say we're creating a third-party component, we'd house our
  // source code in './lib'
  var tree = broccoli.makeTree('lib');

  // create a CJS version
  var cjsTree = filterES6Modules(pickFiles(tree, {
    srcDir: '/',
    destDir: '/cjs'
  }));

  // and AMD
  var amdTree = filterES6Modules(pickFiles(tree, {
    srcDir: '/',
    destDir: '/amd'
  }), {
    moduleType: 'amd'
  });

  return [cjsTree, amdTree];
};

And then from the command line:

$ broccoli build output

Options

  • moduleType - amd or cjs
  • anonymous - for amd output, whether or not to name your modules.
  • packageName - for named-amd output, prepends packageName/ to your module names
  • main - for named-amd output, which file is the main entry point of your module that will be returned with require(['your-package'])
  • every other option supported by the transpiler

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100