direct-dev
Advanced tools
Comparing version 0.1.9 to 0.1.10
{ | ||
"name": "direct-dev", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Yandex Direct dev tools", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -52,3 +52,3 @@ /** | ||
devJs: this._devJs && resolveFilename(this._devJs), | ||
css: this._css &&resolveFilename(this._css) | ||
css: this._css && resolveFilename(this._css) | ||
} | ||
@@ -55,0 +55,0 @@ }; |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
/** | ||
@@ -11,2 +13,3 @@ * sandbox | ||
* * *String* [target] — Результирующий таргет. По умолчанию `?.sandbox.js`. | ||
* * *BlockFilter* [filter] — Фильтр по названию блока и уровням переопределения. По умолчанию - не указан. | ||
* | ||
@@ -17,4 +20,9 @@ * **Пример** | ||
* | ||
* var techs = require('direct-dev').techs; | ||
* const techs = require('direct-dev').techs; | ||
* | ||
* const filter = new BlockFilter( | ||
* { targetBlock: 'block-name', targetLevels: ['source.blocks'] }, | ||
* { rootPath: config.getRootPath() } | ||
* ); | ||
* | ||
* nodeConfig.addTech(techs.devPageBemjson, { target: '?.sandbox.js' }); | ||
@@ -24,5 +32,6 @@ * ``` | ||
var util = require('util'), | ||
vow = require('vow'), | ||
vowFs = require('vow-fs'); | ||
const util = require('util'); | ||
const vow = require('vow'); | ||
const vowFs = require('vow-fs'); | ||
const BlockFilter = require('../lib/block-filter'); | ||
@@ -32,8 +41,9 @@ module.exports = require('enb/lib/build-flow').create() | ||
.target('target', '?.sandbox.js') | ||
.defineOption('filter') | ||
.useFileList('sandbox.js') | ||
.builder(function(paths) { | ||
var node = this.node; | ||
const node = this.node; | ||
const filter = this.getOption('filter', BlockFilter.empty); | ||
return vow.all(paths.map(function(file) { | ||
return vow.all(paths.filter(filter.enb).map(function(file) { | ||
return vowFs.read(file.fullname, 'utf8').then(function(data) { | ||
@@ -40,0 +50,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52
25699
980613