Skip to content

Generating globs dependencies for cedr

License

Notifications You must be signed in to change notification settings

antitim/cedr-deps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cedr-deps NPM version Build Status Dependency Status

Cedr-deps - Generating globs dependencies for cedr.

Installation

$ npm install --save cedr-deps

Usage

Used in conjunction with cedr. Needed to generating globs dependencies for page.

const deps = require('cedr-deps');

let library = {
  'menu': {
    templates: {
      'menu': '<div>Menu</div>',
      '__item': '<div>Menu item</div>'
    },
    styles: {
      'menu/style.css': 'test/lib1/menu/style.css'
    },
    scripts: {}
  },
  'page': {
    templates: {},
    styles: {
      'page/style.css': 'test/lib1/page/style.css'
    },
    scripts: {}
  }
}

let page = {
  block: 'page',
  content: [
    {
      block: 'text',
      content: 'text'
    },
    {
      block: 'page',
      element: 'header',
      content: 'Yeah!'
    }
  ]
};

deps(page, library); 
// Return { style: ['test/lib1/page/style.css'], script: [] }

API

cedr-deps(page, library)

page

Type: Object

The object of page.

library

Type: Object

The object of library.

Returns a Object:

{
  style: [],
  script: []
}

License

MIT © antitim

About

Generating globs dependencies for cedr

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published