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

The behaviour of rebasing URLs when an output is given should be overwriteable #87

Open
Lenni009 opened this issue Mar 22, 2023 · 1 comment

Comments

@Lenni009
Copy link

You sometimes don't want to rebase the URLs, for example when everything stays in the same directory. So if I previously had a folder src/css/ and in it a file with this CSS:

@import 'fonts.css'

clean-css-cli does this:

@import 'src/css/fonts.css'

Now the style breaks because there is no adjacent src folder to the CSS file.

On the contrary, this would be fine (added slash in front of path to make it absolute):

@import '/src/css/fonts.css'

Solutions:

  • Either fix the rebase algorithm to add a / to the rebased URL to make it absolute
  • Give the user an option to overwrite this behaviour. I tried version 4.3, which still had --skip-rebase enabled, and that worked (but threw a bunch of other errors/warnings, so can't use it in prod)
@Lenni009
Copy link
Author

This also happens without the output flag, the imports are always made to be absolute.

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

Successfully merging a pull request may close this issue.

1 participant