Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

please turn convertToAbsoluteUrls explicitly off. #195

Closed

Description

@karolyi

Hey,

I just spent half a day with investigating why my webpack live server (with style-loader) was corrupting the converted bootstrap CSS source.

turns out the culprit is convertToAbsoluteUrls. it entered 9 days ago (https://github.com/webpack-contrib/style-loader/blame/master/addStyles.js#L261-L266) into the codebase.

Unless you don't intentionally want to cause headache for other devs like me, please turn it explicitly off. I had to add its option to my config to fix the SASS rendering with sourcemap, while I almost submitted an issue to the bootstrap guys.

Activity

  1. changed the title [-]please turn convertToAbsoluteUrls explicitly off.[/-] [+]please turn `convertToAbsoluteUrls` explicitly off.[/+] on Mar 20, 2017
  2. changed the title [-]please turn `convertToAbsoluteUrls` explicitly off.[/-] [+]please turn convertToAbsoluteUrls explicitly off.[/+] on Mar 20, 2017
  3. michael-ciniawsky commented on Mar 20, 2017

    @michael-ciniawsky
    Contributor

    @karolyi Config and a small example please

  4. michael-ciniawsky commented on Mar 20, 2017

    @michael-ciniawsky
    Contributor

    If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled and there is no publicPath defined then lets turn convertToAbsoluteUrls on by default. Otherwise default to the convertToAbsoluteUrls option directly

    Just to confirm, this isn't an option for you ?

  5. michael-ciniawsky commented on Mar 20, 2017

    @michael-ciniawsky
    Contributor

    Eventual docs update needed

  6. karolyi commented on Mar 20, 2017

    @karolyi
    Author

    Right now I don't have an easy example, but here's a bug that convertToAbsoluteUrls was causing.

    After transpiling bootstrap.scss into CSS, this line that uses this variable is corrupted as the variable adds the current url to the url("data:image/svg+xml;charset=utf8 ... attribute.

    So in my case, it became:
    url("http://localhost:8000/account/login/data:image/svg+xml;charset=utf8 ...

    which is obviously bad.

    There were more errors which I didn't investigate further, but this was the most eye catching. After turning the option off, the CSS got generated in the right way.

  7. michael-ciniawsky commented on Mar 21, 2017

    @michael-ciniawsky
    Contributor

    @sontek Sry for pinging you again on this, but would you be so kind and take a look again providing me some guidance what to do about it 😛 e.g could it be disabled by default or would it break builds the other way around then again 🙃 ?

  8. sontek commented on Mar 21, 2017

    @sontek
    Contributor

    @karolyi What version of style-loader were you using? This sounds like the issue we fixed in the last PR

  9. sontek commented on Mar 21, 2017

    @sontek
    Contributor

    Oh, looks like no one released that fix. I'm sorry about that @karolyi this is actually fixed (and has been fixed for 4 days), it just hasn't been released to npm yet.

    @michael-ciniawsky Any chance you can push a release with the fix?

  10. michael-ciniawsky commented on Mar 21, 2017

    @michael-ciniawsky
    Contributor

    @sontek Thx

    cc @d3viant0ne @bebraw

  11. sontek commented on Mar 21, 2017

    @sontek
    Contributor

    Should we keep this opened until we release and he verifies?

  12. joshwiens commented on Mar 21, 2017

    @joshwiens
    Contributor

    It's already been released

  13. karolyi commented on Mar 21, 2017

    @karolyi
    Author

    I'll test it soon and give you guys a feedback. bear with me :)

  14. karolyi commented on Mar 21, 2017

    @karolyi
    Author

    can confirm it seems to have fixed in 0.15.0. yesterday I was using 0.14.1.

    cheers guys

  15. sontek commented on Mar 21, 2017

    @sontek
    Contributor

    phew I was going to be very confused if that PR didn't fix it :D

  16. mgol commented on Apr 13, 2017

    @mgol
    Contributor

    This still doesn't work in some cases. I reported #214.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions