webhelp

1.1.5 • Public • Published

webhelp

nodejs package for web application gulp most used tasks

NPM

Exports:

  • gulp: module included and extended gulp;
  • sass: allows register scss compilation;
  • sassConfig: configure scss compilation;
  • scripts: concat, minify and copy javascript files; (TODO: add jshint validation, sourcemaps)
  • scriptsConfig: configure js compilation;
  • styles: concat, minify stylesheets;
  • copy: copy files;
  • watch: add src to run task;
  • config: overall extension configuration;
  • tasks: list all registered tasks;

Examples:

Compile sass

var gulp = require('gulp'),
    webhelp = require('webhelp');
 
webhelp.sass(
    './src/sass/styles.scss',
    './src/sass/**/*.scss',
    'compile-sass',
    'new-name',
    './dist'
);
 
gulp.task('default', function () {
    webhelp.gulp.start('compile-sass');
    webhelp.watch();
});
 
 
// Compiles `./src/sass/styles.scss` file to `./dist/new-name.css` and creates 
// minified version of file `./dist/new-name.min.css`;
//
// When running `gulp default`, it compiles thous files and on change any of 
// `./src/sass/**/*.scss` files, repeat this action;

Concat js

var gulp = require('gulp'),
    webhelp = require('webhelp');
 
webhelp.scripts(
    [
        'app.js',
        '**/*.js'
    ],
    'app',
    'compile-js',
    './src/js',
    './dist'
);
 
gulp.task('default', function () {
    webhelp.gulp.start('compile-js');
    webhelp.watch();
});
 
// Compiles `./src/js/**/*.js` file to `./dist/app.js` and creates 
// minified version of file `./dist/app.min.js`;
//
// When running `gulp default`, it compiles thous files and on change any of 
// `./src/js/**/*.js` files, repeat this action;

See all registered tasks

var gulp = require('gulp'),
    webhelp = require('webhelp');
    
gulp.task('tasks', function () {
    webhelp.tasks();
});
 
// WebHelp available tasks list: 
//       - webhelp-default
//       - webhelp-watch

webhelp-default

Runs all registered tasks throuth webhelp:

gulp.task('my-task', function () {
    // do something cool
});
 
webhelp.sass(
    './src/sass/styles.scss',
    './src/sass/**/*.scss',
    'compile-sass',
    'new-name',
    './dist'
);
 
webhelp.watch('./src/*.html', 'my-task', gulp);
 
gulp.task('default', function () {
    webhelp.gulp.start('webhelp-default');
    // will start 'compile-sass' and 'my-task' tasks
});

install

npm i webhelp

Downloadsweekly downloads

0

version

1.1.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability