# gulp-target

> Merge multiple directories by dependencies to build WL or variants of the project.

Latest version **1.0.0** (published 2016-05-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install gulp-target
pnpm add gulp-target
yarn add gulp-target
bun add gulp-target
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-05-31 |
| First published | 2016-05-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+10 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | bondalex |

## Links

- npm: https://www.npmjs.com/package/gulp-target
- Repository: https://github.com/alexeybondarenko/gulp-target
- Homepage: https://github.com/alexeybondarenko/gulp-target#readme
- Issues: https://github.com/alexeybondarenko/gulp-target/issues
- npm.io page: https://npm.io/package/gulp-target

## Dependencies (5)

- [fs](https://npm.io/package/fs.md) 0.0.2
- [path](https://npm.io/package/path.md) 0.12.7
- [lodash](https://npm.io/package/lodash.md) 4.6.1
- [lazypipe](https://npm.io/package/lazypipe.md) 1.0.1
- [gulp-add-src](https://npm.io/package/gulp-add-src.md) 0.2.0

## Recent versions

- 1.0.0 (latest) — 2016-05-31

## README

# gulp-target

Merge multiple directories by dependencies to build WL or variants of the project.

## Install

```sh
$ npm install --save-dev gulp-target
```

## Usage

Base project structure

```sh
/targets
/targets/targetA - dir of the target `targetA`
/targets/targetB - dir of the target `targetB`
```

Target must have `target.json` file. These config is using for merge process.

Example:

```json
{
  "dependencies": [
    "common"
  ]
}
```

Adding this into your `Gulpfile.js`:

```js
var gulp = require('gulp');
var target = require('gulp-target');
```

Sample usage

```js

gulp.task('target', function () {

  var currentTarget = new target('targetName');

  return gulp.src([]) // some special files not from targets folders
    
    .pipe(currentTarget.pipe()) // <- files will be added here

    .pipe(gulp.dest('.target'))
    .on('error', function () {
      process.exit(1)
    });

});
```

Merging files

```js

gulp.task('target', function () {

  var currentTarget = new target('targetName');

  return gulp.src([]) // some special files not from targets folders
    
    .pipe(currentTarget.pipe())

    .pipe($.if('config.json', $.extend('config.json', { strict: true }))
    .pipe(gulp.dest('.target'))
    .on('error', function () {
      process.exit(1)
    });

});

```

### target.json

`dependencies` - are the names of the folders inside `targetFolder`. They will be included by order in the `target.json`.

## Options

`baseDir` - name of the folder, there targets are located. `targets` by default

`configName` - name of the target config file. `target.json` by default

```js
var currentTarget = new target('targetName', {
  baseDir: 'target',
  configName: 'target.json'
});
```

---
_Source: https://npm.io/package/gulp-target · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
