Skip to content

Does not apply objectUrl for <link> tag when setting sourceMap: true #265

@Aqours

Description

@Aqours

Move from: css-loader with sourceMap: true cause adding style tag delayed

Actually, above issue is caused by style-loader.

https://github.com/webpack-contrib/style-loader/blob/378e90637f1c2c30bff026d7f92bdc82d9d4ecb8/lib/addStyles.js#L354-L363

I have an idea to resolve this issue, but it's not perfect. Consider to apply this solution.

My solution code:
Using code link.href = 'data:text/css;base64,' + btoa(encodeURIComponent(css)); replace line 363.

Test:

  • Chrome 61: √
  • Edge: √
  • IE 11: √
  • Firefox 55: × Bug(maybe)
  • Safari: √

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions