graph: Specify a technology for the dependency
const BemGraph = require('@bem/sdk.graph').BemGraph;
const graph = new BemGraph();
graph.vertex({ block: 'a' })
.dependsOn({ block: 'b' }, 'js');
graph.vertex({ block: 'b' }, 'css')
.dependsOn({ block: 'common-css' });
graph.vertex({ block: 'b' }, 'js')
.dependsOn({ block: 'common-js' });
graph.dependenciesOf({ block: 'a'});
// => [
// { "entity": {"block": "common-js"}, "tech": "js"},
// { "entity": {"block": "b"}, "tech": "js"},
// { "entity": {"block": "a"}}
// ]
no comments