markdown-loader icon indicating copy to clipboard operation
markdown-loader copied to clipboard

Conflict between url-loader and html-loader

Open clauderobi opened this issue 2 years ago • 0 comments

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.

clauderobi avatar Mar 27 '22 19:03 clauderobi