joscha / gulp-rewrite-css

A gulp plugin that allows rewriting url references in CSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Are there any working demo's you can provide?

gward35 opened this issue · comments

I'm wondering if this tool is right for my needs. I tried to create a similar task using replace. I'm not sure based on your usage example where or how I would define the new url. Please see my attempt (which doesnt work)

var config = require('../config');
if (!config.tasks.js) return;

var gulp = require('gulp');
var replace = require('gulp-replace');

var fontURL = function () {
return gulp.src('../site/fractal/components/preview/fonts.css')
.pipe(replace('/assets/fonts/', './'))
.pipe(gulp.dest('../site/fractal/components/preview/fonts.css'));
}

gulp.task('font:url', ['fractal'], fontURL);
module.exports = fontURL

@gward35 you can have a look at the tests to see the module in action with all the different options.