broccoli-compile-modules
v1.1.1
Published
Compile ES6 modules into your desired format.
Downloads
91
Readme
broccoli-compile-modules
Compile ES6 modules into your desired format.
DEPRECATED
Please try broccoli-es6modules instead.
Installation
$ npm install --save-dev broccoli-compile-modules
Usage
var compileModules = require('broccoli-compile-modules');
// ...
var app = compileModules('app', {
inputFiles: ['**/*.js'],
output: '/app.js',
formatter: 'bundle'
});
module.exports = app;
The built-in formatters are bundle
and commonjs
.
Custom Resolvers
In some cases you may need to use one or more custom resolvers. Custom resolvers
are useful in situations where your project or vendor file system layout does
not match the layout expected by the module transpiler's FileResolver
class.
Your custom resolver classes may be passed in directly to the resolvers
option
to be constructed with the correct temporary paths broccoli uses for
intermediate builds. This is generally preferred, but you may also pass in a
resolver instance when that behavior is not desired.
var compileModules = require('broccoli-compile-modules');
var CustomResolver = require('./custom-resolver');
var AnotherResolver = require('./another-resolver');
// ...
var app = compileModules('app', {
inputFiles: ['**/*.js'],
resolvers: [CustomResolver, new AnotherResolver()],
output: '/app.js',
formatter: 'bundle'
});
module.exports = app;
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request