Skip to content

The problem with the calculation of the path to the fonts #8

Description

@khusamov

I have a problem with file paths.

Gulp task:

gulp.task("css", function () {
    let src = ["bower_components/bootswatch/united/bootstrap.css"];
    let options = { keepStructure: true, relative: true, assetsPath: "assets" };
    gulp.src(src)
        .pipe(postcss([assetsRebase(options)], { to: "public/build/all.css" }))
        .pipe(concatCss("all.css"))
        .pipe(gulp.dest("public/build"));
});

At the entrance to the file:

bower_components/bootswatch/united/bootstrap.css:

@font-face {
    src: url('../fonts/glyphicons-halflings-regular.eot');
}

The output is a file with an error (wrong path):

public/build/all.css:

@font-face {
    src: url("../../bootswatch/united/assets/bower_components/bootswatch/fonts/glyphicons-halflings-regular.eot");
}

And here I should get the file:

@font-face {
    src: url("assets/bower_components/bootswatch/fonts/glyphicons-halflings-regular.eot");
}

How do I configure a task so that the path to the font correctly calculated?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions