Skip to content

Conflict between url-loader and html-loader #89

@clauderobi

Description

@clauderobi

Actually, this is not an issue since I have a solution. I am just posting here for others that may have the same problem.

Coming from webpack 4, I was using url-loader. Somehow, when using url-loader for the image type(s) that may appear in my normal html/js code AND in my markdown document the result was that the images were not working with markdown. The image file content was replaced with some JS export directive. By excluding the type(s) that I needed with the markdown document from the generic rule (test) related to url-loader then there is conflict and all is good. Obviously this mean I can not use the same type of file for both normal html/js and markdown, which is not good.. :-(

However, with Webpack 5, a new native module exists, which remove the need to use url-loader. This module (Asset) is apparently smart enough not to conflict with html-loader. This allows to have a generic rule supporting all image types while still be able to use the same type in markdown.

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