metalsmith-babel
babel plugin for Metalsmith
Installation
npm install metalsmith-babel
Usage
CLI
Add the metalsmith-babel
field to your metalsmith.json
.
{
"plugins": {
"metalsmith-babel": {
"modules": "common",
"comments": true
}
}
}
API
var Metalsmith = require('metalsmith');
var babel = require('metalsmith-babel');
new Metalsmith('./source')
.use(babel({/* 6to5 options */}))
.build(function(err, files) {
if (err) {
throw err;
}
console.log('Completed.');
});
Options
All babel options are available except for filename
and filenameRelative
that will be automatically set.
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.