reduce-css
Pack CSS into common shared bundles.
Features:
- Accept patterns to add entries.
- Use
depsify
to pack css files into bundles. - Use
postcss
to preprocess css. - Use
watchify2
to watch files, which is able to detect new entries. - Use
common-bundle
to create common shared modules by default, which makeb.bundle()
output a stream manipulatable bygulp
plugins.
Example
Check the example.
var reduce = var del = var path = { var basedir = path var b = reduce return b} { var build = path del return b } { consolelog}
To watch file changes:
var b = b
To work with gulp:
var gulp = gulp gulp
API
var reduce = var b = reduce
reduce.create(entries, depsifyOptions, bundleOptions, watchifyOptions)
Return a depsify
instance.
entries
: patterns to locate input files. Checkglobby
for more details.depsifyOptions
: options fordepsify
. IfdepsifyOptions.postcss
is notfalse
, the pluginreduce-css-postcss
fordepsify
is applied, which usepostcss
to preprocess css.bundleOptions
: options forcommon-bundle
.watchifyOptions
: options forwatchify2
. If specified, file changes are watched.
b.bundle()
Return a vinyl
stream,
which can be processed by gulp plugins.
b
b.dest(outFolder, urlTransformOptions)
Works almost the same with gulp.dest
,
except that file contents are transformed using postcss-custom-url
before written to disk.
urlTransformOptions
is passed to both
the inline
and copy
transformers for postcss-custom-url
.
The actual processor:
var url = var postcss = var urlProcessor =