I'm running into this issue with font-awesome, which also has relative URLs in the CSS file;
url('../fonts/fontawesome-webfont.eot?v=4.7.0');
I think, at least, the example code should be updated to check for paths that start with ../fonts, but I also think that's less than ideal, since that prefix isn't as unique as ../node_modules, so there could be matches with non-vendor files as well.
I think there should be a way to only apply the processRelativeUrl function to relative URLs that are contained in files within the node_modules directory. In other words, I think checking what the relative URL starts with is the wrong test, since files in node_modules often have relative URLs that do not start with node_modules.
Are there any easy ways to resolve relative URLs relative to the file they are included in, like CSS does by default? I've tried setting rebaseUrls: false which works partially, but then all URLs are resolved relative to the CSS bundle, rather than the @imported files that they originate in.
In the example for how to load font and image files from node_modules, the paths in bootstrap.css begin with
../fonts/
not with../node_modules
so the files don't seem to get copied.I'm running into this issue with
font-awesome
, which also has relative URLs in the CSS file;I think, at least, the example code should be updated to check for paths that start with
../fonts
, but I also think that's less than ideal, since that prefix isn't as unique as../node_modules
, so there could be matches with non-vendor files as well.I think there should be a way to only apply the
processRelativeUrl
function to relative URLs that are contained in files within thenode_modules
directory. In other words, I think checking what the relative URL starts with is the wrong test, since files innode_modules
often have relative URLs that do not start withnode_modules
.Are there any easy ways to resolve relative URLs relative to the file they are included in, like CSS does by default? I've tried setting
rebaseUrls: false
which works partially, but then all URLs are resolved relative to the CSS bundle, rather than the@import
ed files that they originate in.