Allow css modules to declare their dependencies and pack in custom ways. See reduce-css.
The main ideas are borrowed from browserify
var Depsify = require('../')
var path = require('path')
var del = require('del')
var fixtures = path.resolve.bind(path, __dirname)
var DEST = fixtures('build')
var atImport = require('postcss-simple-import')
var url = require('postcss-custom-url')
var vars = require('postcss-advanced-variables')
del(DEST).then(function () {
new Depsify({
basedir: fixtures('src'),
entries: ['a.css', 'b.css'],
processor: [
atImport(),
url(url.util.inline),
vars(),
],
})
.bundle()
.pipe(process.stdout)
})
basedir
entries
plugin
transform
processor
- And all options supported by css-module-deps
add(file, opts)
plugin(p, opts)
transform(tr)
processor(p)
bundle()
file
transform
dep
reset
bundle