Skip to content

Allow css modules to declare their dependencies and pack in custom ways

License

Notifications You must be signed in to change notification settings

reducejs/depsify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

depsify

version status coverage dependencies devDependencies node

Allow css modules to declare their dependencies and pack in custom ways. See reduce-css.

The main ideas are borrowed from browserify

Related

Example

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)
})

var b = new Depsify(entries, options)

Options

  • basedir
  • entries
  • plugin
  • transform
  • processor
  • And all options supported by css-module-deps

Methods

  • add(file, opts)
  • plugin(p, opts)
  • transform(tr)
  • processor(p)
  • bundle()

Events

  • file
  • transform
  • dep
  • reset
  • bundle

About

Allow css modules to declare their dependencies and pack in custom ways

Resources

License

Stars

Watchers

Forks

Packages

No packages published