8000 Rethinking the css- and html-loader · Issue #220 · webpack/webpack · GitHub
[go: up one dir, main page]

Skip to content
Rethinking the css- and html-loader #220
@jhnns

Description

@jhnns

The css- and html-loader are currently creating a string like this:

"module.exports = '<html><body><img src=\"' + require(\"./some/img.jpg\") + '\"></body></html>";

I think this behavior violates the rule that a loader should do only one thing because it turns an html-string into a javascript-module. That's exactly what the raw-loader does.

Wouldn't it be better if the html- and css-loader just replaced all referenced urls (without wrapping them in a require() statement) and then pass the string to the next loader?

webpack could then also be used as a bundler for static webpages that don't want to render themselves via JavaScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0