Gulp.js - Rewrite urls embedded in css while concatenating

前端 未结 2 2064
青春惊慌失措
青春惊慌失措 2021-02-19 11:46

I\'m using Gulp to concatenate several css files from different directories (Bower managed dependencies). Font-awesome is one of these dependencies and it contains a relative re

相关标签:
2条回答
  • 2021-02-19 12:11

    Another option is gulp-css-rebase-urls which was built to address this problem.

    https://www.npmjs.com/package/gulp-css-rebase-urls

    0 讨论(0)
  • 2021-02-19 12:13

    You can use gulp-replace. https://npmjs.org/package/gulp-replace

    **gulp-replace can be called with a string or regex.**
    
    *replace(string, replacement)*
    
    string
    
    Type: String
    
    The string to search for replacement
    
    Type: String
    
    The replacement string.
    
    *replace(regex, replace)*
    
    Note: gulp-replace cannot perform regex replacement on streams.
    
    regex
    
    Type: RegExp
    

    You could also use gulp-frep

    0 讨论(0)
提交回复
热议问题