Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebasing based on path module #49

Open
GauntletPL opened this issue Sep 26, 2019 · 0 comments
Open

Rebasing based on path module #49

GauntletPL opened this issue Sep 26, 2019 · 0 comments

Comments

@GauntletPL
Copy link

Using path module to rebase remote resources causes URLs to be messed up and fail.

Example:

My HTML has Bootstrap css file referenced like this:
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Bootstrap references font files like this:
src:url(../fonts/glyphicons-halflings-regular.eot);

html.js is invoking css.js passing rebaseRelativeTo option calculated as path.join( settings.relativeTo, args.src, ".." + path.sep ). This produces https:/netdna.bootstrapcdn.com/bootstrap/3.3.7/css/ (double slash was lost as a result).

In the end https:/netdna.bootstrapcdn.com/bootstrap/3.3.7/css/ is not treated as a remote (RegExp test fails) and font is attempted to be retrieved from /local/directory/path/https:/netdna.bootstrapcdn.com/bootstrap/3.3.7/css\fonts/glyphicons-halflings-regular.eot

path.join() and path.relative() should not be used while dealing with remotes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant