转载

用 Rollup 和 Buble 编译 ES6 代码

bubleuptranspiles ESnext code

with the power ofRollup and Buble .

tl;dr

$ bubleup
# is the same as
$ bubleup src/index.js -o index.js

Install

$ npm install -g bubleup

Usage

For full CLI usage please run bubleup -h , It's hard to describe some options in command line, so you can also configure them in package.json, eg:

{
  "bubleup": {
    "entry": "./path/to/my-entry.js"
  }
}

Alias

This is some feature which is similar to Webpack's alias , eg:

{
  "bubleup": {
    "alias": {
      "controllers": "./src/controllers"
    }
  }
}

Paths

This helps you import some file from the CDN (as using AMD), or set an alias to an external file, see more details in Rollup's WIKI .

API

import bubleup from 'bubleup'

bubleup(options).catch(e => console.log(e.stack))

License

MIT ©EGOIST

原文  https://github.com/egoist/bubleup
正文到此结束
Loading...