@khalyomede/fang-browserify

0.1.1 • Public • Published

Fang Browserify

Fang plugin to use browserify.

Summary

Installation

  1. Install fang
npm install --save-dev @khalyomede/fang@0.*
  1. Install this package
npm install --save-dev @khalyomede/fang-browserify@0.*
  1. Create a script alias
// package.json
{
  "scripts": {
    "fang": "fang"
  }
}
  1. Create a task file (at the root of your folder)
// fang.js
const fang = require('@khalyomede/fang');
const browserify = require('@khalyomede/fang-browserify');

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

const build = [js];

module.exports = { build };

Usage

Example 1: simple usage

In this example, we will convert our modules imports into a browser-compatible javascript code.

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

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

const build = [js];

module.exports = { build };

Example 2: with options

In this example, we are using some of the options provided by browserify to customize the behavior of this module.

const fang = require('@khalyomede/fang');
const browserify = require('@khalyomede/fang-browserify');

const js = () => fang.from('src/js/**/*.js')
  .do(browserify({
    debug: true // add a soure map inlined at the end of the file
  }))
  .save('dist/js');

const build = [js];

module.exports = { build };

Package Sidebar

Install

npm i @khalyomede/fang-browserify

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

7.17 kB

Total Files

6

Last publish

Collaborators

  • khalyomede