Naturally Produced Modules
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

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'));

install

npm i gulp-append-url-version

Downloadsweekly downloads

0

version

0.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability