Skip to content

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

License

Notifications You must be signed in to change notification settings

niksy/bundle-collapser-extended

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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ć

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%