-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Description
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
Labels
No labels