用 buble 转换 hexo 主题里的 ES2015 代码

423 阅读1分钟

NPM version NPM downloads Build Status

Install

$ npm install --save hexo-renderer-buble

Usage

Just install this package and you're all set, if you want custom options for buble, simply do:

# _config.yml
buble:
  transforms:
    dangerousForOf: true

Check out all buble options: buble.surge.sh/guide/#usin…

include

By default it transforms all .js .jsx .es6 files, but you can also set include to transform specified files only:

buble:
  include: **/foo.js
  # or array
  include:
    - **/foo.js
    - **/js/bar.js

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST


本文对你有帮助?欢迎扫码加入前端学习小组微信群: