Skip to content

tkorakas/gulp-cdn-url-append

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp CDN url append

Find and replace all url paths on your CSS with CDN. Also append a unique token at the end of the path. This will help you to invalidate your file on every change.

Installation

Install via npm:

npm install gulp-cdn-url-append --save-dev

Example

const gulp = require('gulp');
const cdnAppend  = require('gulp-cdn-url-append');
const cdnUrl = 'http://my.cdn.com';

gulp.task('default', function() {
    return gulp.src('./style.css')
        .pipe(cdnAppend(cdnUrl));
});

Result: background-image: url('http://my.cdn.com/images/logo.png?cid=fkelfekflekflefke')

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Thanos Korakas

About

Find and replace all url paths on your CSS with CDN.

Resources

License

Stars

Watchers

Forks

Packages

No packages published