scniro/gulp-clean-css

libs word being replaced for css

gbschalch opened this issue · 2 comments

Hi!

I have a .css file which contains a font file path (url) which has the "libs" word in it. After being processed by gulp clean css pipe, it's being replaced from "libs" to "css". Why?

Here's the pipe:

gulp.task('create-static-css', ['clear'], function() { return gulp.src([sourceAssets+'libs/**/*.css', '!'+sourceAssets+'css/**/*.css']) .pipe(sourcemaps.init()) .pipe(concat('static.css')) .pipe(autoprefixer('last 2 versions')) .pipe(rename({suffix:'.min'})) .pipe(minifycss()) .pipe(sourcemaps.write('/maps')) .pipe(gulp.dest(buildAssets+'css/')) });

CSS declaration:
@font-face{font-family:Font Awesome\ 5 Brands;font-style:normal;font-weight:400;src:url(../libs/fontawesome/fa-brands-400.eot);

The path part results to:
../css/fontawesome/fa-brands-400.eot

--

Thanks in advance,

Guilherme Burger Schalch
Front End Developer

Does it still happen when you do .pipe(minifycss({rebase: false}))?

@gbschalch this is probably best to ask on StackOverflow as I suspect the issue could be specific to your implementation. You may also checking out clean-css rebaseTo helpful in this situation