https://github.com/shinnn/metalsmith-buble
Bublé plugin for Metalsmith
https://github.com/shinnn/metalsmith-buble
buble build-tool compiler ecmascript javascript jsx metalsmith metalsmith-plugin nodejs
Last synced: 2 months ago
JSON representation
Bublé plugin for Metalsmith
- Host: GitHub
- URL: https://github.com/shinnn/metalsmith-buble
- Owner: shinnn
- License: isc
- Created: 2016-08-26T09:46:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T10:02:02.000Z (over 7 years ago)
- Last Synced: 2025-03-26T22:43:49.274Z (2 months ago)
- Topics: buble, build-tool, compiler, ecmascript, javascript, jsx, metalsmith, metalsmith-plugin, nodejs
- Language: JavaScript
- Size: 43 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metalsmith-buble
[](https://www.npmjs.com/package/metalsmith-buble)
[](https://travis-ci.org/shinnn/metalsmith-buble)
[](https://ci.appveyor.com/project/ShinnosukeWatanabe/metalsmith-buble/branch/master)
[](https://coveralls.io/r/shinnn/metalsmith-buble)[Bublé](https://github.com/Rich-Harris/buble) plugin for [Metalsmith](http://www.metalsmith.io/)
## Installation
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
```
npm install metalsmith-buble
```## Usage
### [CLI](https://github.com/metalsmith/metalsmith#cli)
Add the `metalsmith-buble` field to your `metalsmith.json`.
```javascript
{
"plugins": {
"metalsmith-buble": {
"transforms": {
"modules": false,
"dangerousForOf": true
},
"sourceMap": "inline"
}
}
}
```### [API](https://github.com/metalsmith/metalsmith#api)
```javascript
const Metalsmith = require('metalsmith');
const buble = require('metalsmith-buble');new Metalsmith('./source')
.use(buble({
sourceMap: true
}))
.build((err, files) => {
if (err) {
throw err;
}console.log('Completed.');
});
```### Options
All [Bublé options](https://buble.surge.sh/guide/#using-the-javascript-api) are available except for `file` and `source` that will be automatically set.
In addition the following option is supported:
#### options.sourceMap
Value: `true`, `false` or `'inline'`
Default: `false`* `true` generates a separate source map file with `.map` extension, for exmaple `script.js.map` along with `script.js`.
* `'inline'` appends an inline source map to the transformed file.## License
[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe