1.0.8 • Published 2 years ago

@vivi-project/gulp-task v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

VIVI PROJECT:// GULP-TASK

A tool for quick and easy task creation that will avoid code repetition.


Install

$ npm i @vivi-project/gulp-task

Usage

This will be similar to how you normally create a task for Gulp. First you need to initialize the class and assign it to a variable:

import { dest } from 'gulp';
import scss from 'gulp-scss';
import autoprefixer from 'gulp-autoprefixer';
import CreateTask from '@vivi-project/gulp-task';

const task = new CreateTask('./index.scss', {allowEmpty: true});

Use a setter common to determine the shared flow for modes developing and production. Setters developing and production extend stream transmitted to the common setter. The result method returns the task depending on the passed value:

import { dest } from 'gulp';
import scss from 'gulp-scss';
import autoprefixer from 'gulp-autoprefixer';
import CreateTask from '@vivi-project/gulp-task';

const task = new CreateTask('./src/index.scss', {allowEmpty: true});

task.common = src => src
	.pipe(scss());

task.developing = src => src
	.pipe(desc('./dest'));

task.production = src => src
	.pipe(autoprefixer())
	.pipe(desc('./dest'));

const devTask = task.result('dev');
const prodTask = task.result('prod');

export { devTask, prodTask }

Methods

MethodDescriptionArgumentsReturns
1commonDefine common streamcallback: () => NodeJS.ReadWriteStreamvoid
2developingExtending the general flow for developing modecallback: (src: NodeJS.ReadWriteStream) => NodeJS.ReadWriteStreamvoid
3productionExtending the general flow for production modecallback: (src: NodeJS.ReadWriteStream) => NodeJS.ReadWriteStreamvoid
4resultGetting a complete taskmode: 'dev' or 'prod'NodeJS.ReadWriteStream
1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago