bundle-collapser-extended

1.0.3-0 • Public • Published

bundle-collapser-extended

Build Status

Extended version of bundle-collapser, providing support for custom collapsing and presets.

For all original information regarding this package, visit bundle-collapser homepage.

CLI usage is not available for now.

Installation

npm install bundle-collapser-extended --save

API

API is the same as in original package, except it adds additional option of providing custom collapsing and presets.

var stream = collapse(src, opts)

opts.custom takes array of replacement objects, with properties:

  • replacement: replacement for found node, where %s is used as placeholder for replacement module ID
  • value: original module ID
  • check: provides argument node which is currently traversed node. It should return boolean to indicate that this is the node you want to replace.

opts.preset takes array of strings or replacement objects. If defined as string, it will look inside lib/preset directory for predefined preset. Preset should return object in same format as replacement object for opts.custom.

If it’s not defined as string, it will use replacement object in the same format as opts.custom.

Presets

License

MIT, original package by substack, modifications by Ivan Nikolić

Package Sidebar

Install

npm i bundle-collapser-extended

Weekly Downloads

1

Version

1.0.3-0

License

MIT

Last publish

Collaborators

  • niksy