Socket
Socket
Sign inDemoInstall

stitch-gulp-make-css-url-version

Package Overview
Dependencies
57
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stitch-gulp-make-css-url-version

replace version for images in css files


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

gulp-make-css-url-version

a plugin for gulp.js to replace version for images in css files,the version should be file's md5 or time stamp;

Installation

npm install stitch-gulp-make-css-url-version

Usage

var makeUrlVer = require('stitch-gulp-make-css-url-version');

gulp.task('stylesheets', function() {
    gulp.src('css/*.css')
        .pipe(makeUrlVer())
        .pipe(gulp.dest('dist'))
});

Options

useDate :make version with time stamp

var makeUrlVer = require('stitch-gulp-make-css-url-version');

gulp.task('stylesheets', function() {
    gulp.src('css/*.css')
        .pipe(makeUrlVer({useDate:true}))
        .pipe(gulp.dest('dist'))
});

assetsDir: specify the public directory for correct MD5 calculation in some specific cases

var makeUrlVer = require('stitch-gulp-make-css-url-version');

gulp.task('stylesheets', function() {
    gulp.src('css/*.css')
        .pipe(makeUrlVer({
            assetsDir: __dirname + '/public'
        }))
        .pipe(gulp.dest('dist'))
});

Example

before: index.css

/* loading */
.i-loading{width:32px;height:32px;background:url(../images/loading.gif) no-repeat;}    

after: index.css

/* loading */
.i-loading{width:32px;height:32px;background:url(../images/loading.gif?v=Je0sUcMH0mhJPWdZdpHzXg%3D%3D) no-repeat}

Keywords

FAQs

Last updated on 04 Nov 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc