-
Notifications
You must be signed in to change notification settings - Fork 323
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 functionality very frustrating #152
Comments
Hi @TheSisb! As you correctly pointed out the problem lies in cloning the directory. After all But there has to be a solution and we will be happy to help you find it. We'll try to recreate the problem locally. |
Thanks for the reply. The command from my makefile is: (Starting in htdocs/cssSource dir)
So "cssSource" and "css" folders are siblings, and all the css go into the "app" dir within them. Could there just be a parameter to remove rebasing? -r false or something? |
@TheSisb thanks for getting back to us. We'll give it a try shortly as there may be a way to make it work. |
@TheSisb By the last line of your Makefile we assume all images are in |
aw.css is part of a third party library. I don't want to have to modify the image paths inside it so everything remains operational when it updates.
So we put it in its own folder and added all the images necessary there as well (counter to our own directory conventions). All our other CSS files (our own) have absolute paths so they're fine. |
Since aw.css references images relatively, then by merging all CSS files into There are at least two ways of solving this issue:
This gets a bit complicated so disabling rebasing altogether could be a better option though. |
Speed also plays a role in this (grunt watch runs the process on the fly whenever I save a CSS file). For the first method you propose, I would then have to delete the source files from the destination folder after moving them and combining / compressing. This would require a list of files to delete so that the new compiled.css file is not removed. I'd have to manage that when new files are added. As it stands I want to change my build process to cat *.css so I don't need to worry about managing a list of CSS files at all. The second way could work, I'd need to test that. It just seems more straightforward to toggle off the rebasing functionality to me. |
It indeed gets a bit cumbersome. Please test #2 if possible but after all we may need a 'no rebasing' option not only for you.
|
Hey I just tested it and unfortunately it didn't work for me. Paths were still broken no matter how I did it. Only way would be to move it first and that option is not optimal. |
@TheSisb clean-css 1.1.4 is out with |
[edit] Works! thanks. |
@TheSisb That's odd. With --skip-rebase clean-css does no transformations except when processing imports but this is desirable since you are inlining one file inside another which may be at a different path. Does it fail on one file or all images are incorrectly referenced? |
Hi,
Love this module and use it on our web app. Recently ran npm update and cleancss was updated with the new features. Two of which are the rebasing capability and @import processing.
I quickly found and fixed the @import in our CSS, that was helpful. On the other hand, I can't seem to figure out how to fix the rebasing. The documentation is very unclear on how to specify the path. I tried:
-r css/app
-r "css/app"
-r ["css/app"]
-root (all the above)
etc.
Our folder structure is: /var/www/htdocs/cssSource/app/ for the source and /var/www/css/app for production after minification. I really cannot see how to make this work and I may just downgrade. Everytime I run cleancss it either sets the full path (/var/www/etc...) or keeps "cssSource/app" which is not what I want. This happens because I have an intermediate step where I compress the CSS to the same directory and then clone that directory to the css/app dir. I cannot compress directly into the CSS dir.
Any way to fix this?
The text was updated successfully, but these errors were encountered: