Open markadrake opened 8 years ago
Can you post your gulp task? And can you provide the stack traces?
Hello!
I'm having exactly the same issue. I want to specify the base path from which all stylesheet files should be resolved. Because I have nested HTML files and I want to specify absolute path to CSS from them.
Wow, I've managed to resolve the issue after looking in this module's source code.
I've specified the base path the following way:
.pipe(gulpInlineCss({
url: 'file://' + __dirname + '/dist/',
// ...
}))
I would recommend to update the documentation for url
parameter, because right now it is incomplete. I would have never guessed to use file://
prefix.
Thank you!
My gulp src begins with:
My stylesheet has the following path:
I call InlineCSS:
I get errors trying to access the CSS file.
The results are pretty funky.
How is InlineCSS determining the path to my CSS file? Sometimes it wants to pull the directory structure in from the asterisks (first example) other times it completely ignores the path (second and third example) and going up one directory takes you completely out of the dist folder all together (third example).
Is there no way to tell InlineCSS that dist is the root of my site?
I see an options.url available - placing anything here has been unsuccessful. It's definitely not liking strings, it seems to try and access my localhost when I provide anything here. And my site is not running, because the build is not complete.