A Simple Toolset to Help Install & Uninstall Gulp Plugins.
sudo npm install gulp-install-tools --save-dev
sudo npm install --save-dev gulp-{util,data,add-src,notify,filter,git,include,template,imagemin,tag-version,bump,flatmap,if,concat,uglify,responsive,rename,replace,pug,verb}
const gulp = require('gulp'),
$ = require('gulp-install-tools')(gulp, [ // List of Gulp Plugins you want installed
'util',
'data',
'add-src',
'notify',
'filter',
'git',
'include',
'template',
'imagemin',
'tag-version',
'bump',
'flatmap',
'if',
'pug',
'concat',
'uglify',
'responsive',
'rename',
'replace',
'verb'
])
# whatever is in the list will be installed
gulp install
or
# whatever is not in the list will be uninstalled
gulp uninstall
gulp.task('default',() => {
return gulp.src('./templates/pages/*.pug')
.pipe($.pug({pretty: true}))
.pipe(gulp.dest('./dist'));
});
The
install
task is to install tasks that are in your list of specified packages
gulp install
The
uninstall
task is to uninstall tasks that are not in your list of specified packages
gulp uninstall
The
bump
task is to bump the package.json version number by one at each float point common args are ['--patch','--minor','--major','--pre']
# Bumps the version to *.*.1
gulp bump
# Bumps the version to *.*.1
gulp bump --patch
# Bumps the version to *.1.*
gulp bump --minor
# Bumps the version to 1.*.*
gulp bump --major
# Bumps the version to *.*.*-0
gulp bump --pre
The
init
task is to initialize an empty repository in your directory if one already exists it does nothing but tell you one already exists
gulp init
The
tag
task is to create a git tag from the package.json version
gulp tag
Note: You will have to use the sudo
command before it
The
commit
task is to commit changes to your repo common args are['--message']
sudo gulp commit
sudo gulp commit --message "Initial Commit"
Note: You will have to use the sudo
command before it
The
publish
task is to publish your package to npmjs very helpful if your developing your own gulp plugin or a normal npm package it depend on thetag
&commit
tasks which both depend on theinit
task
sudo gulp publish
The easiest way that i have found to do this is:
gulp bump;sudo gulp publish
Jeremy Bolding
Copyright (c) 2016 Jeremy Bolding, All Rights Reserved. Licensed under the MIT License.