URL rebasing from index.html
See original GitHub issueHi
I’m using gulp-clean-css with the version 3.4.23. I’m trying to pack all css files into one, loading it from the index.html
<!-- application css --> <link rel="stylesheet" type="text/css" href="style/application/bootstrap.css"> <!-- endbuild -->
And in the gulp
return gulp.src('src/index.html') .pipe(gulpif('*.css', cleanCSS({options}))) .pipe(uncache()) .pipe(gulp.dest(buildDir));
What options should use to properly rebase the url() inside css file. Resources from url can be allocated in different folders, and they are copy to buildDir. Like: src/a/b/image.png -> buildDir/a/b/image.png
I was playing with relativeTo, target, root, rebase(true/false) and nothing seems to work.
Issue Analytics
- State:
- Created 7 years ago
- Comments:32
Top Results From Across the Web
URL rebasing from index.html #854 - clean-css/clean ... - GitHub
Hi I'm using gulp-clean-css with the version 3.4.23. I'm trying to pack all css files into one, loading it from the index.html.
Read more >URL rebasing feature - Stack Overflow
1) With Html elements that don't have runat = “server” attribute, absolute and relative paths are sent to the browser as they are....
Read more >HTML::Rebase - rewrite HTML links to be relative to a given URL
Rewrites all HTML links to be relative to the given URL. This only rewrites things that look like src= and href= attributes. Unquoted...
Read more >Rebasing - Ry's Git Tutorial - RyPress - hamwaves.com
First, make a new directory in my-git-repo called about . Then, create the empty file about/index.html . Stage and commit a snapshot. git...
Read more >Introduction to Git rebase and force-push - GitLab Docs
This guide helps you to get started with rebasing, force-pushing, and fixing merge conflicts locally. Before diving into this document, make sure you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is odd.
I assume you don’t use
rebase: false
as an option, right? Does the same thing happen with image URLs as well?Re 1 - that’s because you need to point
relativeTo
differently, e.g. this works fine:Re 2 - this is not up to clean-css as it receives a piped file from gulp, namely useref plugin. I’m pretty sure you can patch useref to turn all
<link...
statements into@import
rules, so do the current manualapplication.css
step in-memory.