@khalyomede/fang-babel

0.1.0 • Public • Published

Fang Babel

Fang plugin to use babel.

Summary

Installation

  1. Install fang
npm install --save-dev @khalyomede/fang@0.*
  1. Install this plugin
npm install --save-dev @khalyomede/fang-babel@0.*
  1. Create a task file (on the root of your folder)
// fang.js
const fang = require('@khalyomede/fang');
const babel = require('@khalyomede/fang-babel');

const js = () => fang.from('src/js/**/*.js')
  .do(babel())
  .save('dist/js');

const build = [js];

module.exports = { build };

Usage

Example 1: simple usage

In this example, we will convert our javascript files to supports earlier browser using babel.

// fang.js
const fang = require('@khalyomede/fang');
const babel = require('@khalyomede/fang-babel');

const js = () => fang.from('src/js/**/*.js')
  .do(babel())
  .save('dist/js');

const build = [js];

module.exports = { build };

Example 2: with options

In this example, we will ask babel to add an additional inlined source map using the options parameter of this plugin.

// fang.js
const fang = require('@khalyomede/fang');
const babel = require('@khalyomede/fang-babel');

const js = () => fang.from('src/js/**/*.js')
  .do(babel({
      sourceMaps: 'inline'
  }))
  .save('dist/js');

const build = [js];

module.exports = { build };

Package Sidebar

Install

npm i @khalyomede/fang-babel

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

5.53 kB

Total Files

4

Last publish

Collaborators

  • khalyomede