gulp-append-url-version

0.0.4 • Public • Published

gulp-append-url-version

To append url version params with md5 for background/background-image in css files.

Usage

gulp.src([
		'./**/*.css'
])
.pipe(appendUrlVersion({
	//@optional
	debug: true,
	//@optional
	onComplete: function (cssFile, newContent) {
		//u can overwrite the original file here
	},
	//@optional
	resolveUrlToFilePath: function (cssFile, href) {
		//resolve the absolute file path
		//default return path.resolve(cssFile.path, url.parse(href).pathname);
	},
	//@optional
	//@return false if u dont want to handle this url resource
	check: function (cssFile, cssMeta, href) {
		/*
		cssMeta: is a meata data described every css prop and its values,
		refer to https://github.com/reworkcss/css
		 */
		//default return  (is 'backgroujd' or 'background-image') && is like image url
	},
	//@optinal default 'v'
	paramKey: 'v'
}))
.pipe(gulp.dest('./dist'));

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i gulp-append-url-version

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • zhenyong