ismaGNU / gulp-wp-rev

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ezoic increase your site revenue

About

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

License:MIT License


Languages

Language:JavaScript 83.3%Language:PHP 15.8%Language:CSS 0.9%