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.

Add sourceURL to inline styles #30

Closed

Description

@pstoica

Hey, I've been looking for a way to use CSS sourcemaps in dev with watch or dev-server, which unfortunately means extract-text-webpack-plugins can't be used.

However, I did find out that sourceURL works for inline <style> tags so I'm creating a temporary loader to add that to the end of CSS modules. Could this be done automatically through style-loader? I'd be happy to make a pull request, just let me know if you have any specifics regarding URL naming. Thanks!

(FYI this only seems to work in Chrome, but good enough for now)

Activity

  1. sokra commented on Oct 30, 2014

    @sokra
    Member

    I tried to add SourceMaps to inline <style>... https://github.com/webpack/style-loader/blob/master/addStyles.js#L98-L103

    but it doesn't seem to work. You can try to get this working (i. e. try a <link> with DataUrl).

  2. pstoica commented on Oct 30, 2014

    @pstoica
    Author

    The idea with sourceURL is that it would at least give the devtools a name to reference the style tag by, so it would show up in an element's style panel and in the sources panel, even if you don't have sourcemaps (I currently can't use the CSS loader because of a bunch of missing urls; need to keep all that untouched for now).

    But it does look like <link> with base64 would also work (tested it out briefly with sourceURL). I'll let you know how it goes. Thanks!

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