W
W
Wizardzim2015-10-05 17:16:49
css
Wizardzim, 2015-10-05 17:16:49

How to configure Gulp to automatically pull up images, fonts, etc. when concatenating and minimizing CSS?

I decided to simplify my life and build everything using Gulp and main-bower-files , incl. bower components.
Almost immediately I ran into a problem:
In CSS (LESS), in my particular case, relative urls (images, fonts) are written - for example, in Bootstrap.
And these pictures and fonts themselves are not copied, moreover, the paths to these files are not corrected (and there may be the same paths like ../images/images.png ).
I tried to do something with gulp-concat-css gulp-replace gulp-minify-css gulp-flatten gulp-rename but something didn't work out the way I wanted.
gulp-concat-css can rebaseUrls, but doesn't touch dependent files at all.
Is there any standard solution?
Which would:

  • parsed the CSS url in the source
  • replaced URL

And then it would be possible to work with this:
  • concatenate
  • minify

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
ChickenGrinder, 2015-10-08
@ChickenGrinder

At gulpjs.com/plugins, searching for 'rebase' returns several results, have you tried these plugins?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question