npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

gulp-wp-rev

0.3.0 • Public • Published

gulp-wp-rev

gulp-wp-rev plugin for gulp

Revisioning CSS/JS appending a hash in you assets of wordpress theme.

styles.css?ver=1styles.css?ver=bd0622b828f9346876088cd617566fa5

demo

Usage

First, install gulp-wp-rev as a development dependency:

npm install --save-dev gulp-wp-rev

Then, add it to your gulpfile.js:

var wpRev = require('gulp-wp-rev');
 
gulp.task('rev', function() {
    gulp.src('./wp-content/themes/raulghm-theme/lib/scripts.php')
    .pipe(wpRev({
        css: 'src/styles/styles.css',
        cssHandle: 'my_assets',
        js: 'src/scripts/scripts.js',
        jsHandle: 'my_assets'
    }))
    .pipe(gulp.dest('./wp-content/themes/raulghm-theme/lib'));
});

API

wp-rev(options)

options.css

Type: String

css source file

options.js

Type: String

js source file

options.cssHandle

Type: String

Name used as a handle for the stylesheet.

options.jsHandle

Type: String

Name used as a handle for the javascript.

License

MIT © raulghm

install

npm i gulp-wp-rev

Downloadsweekly downloads

7

version

0.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability