mirror of https://github.com/webpack/webpack.git
fix: bug with case sensitive plugin and data: protocol
This commit is contained in:
parent
bb1ae43297
commit
230f830b4f
|
@ -9,6 +9,7 @@ const CaseSensitiveModulesWarning = require("./CaseSensitiveModulesWarning");
|
||||||
|
|
||||||
/** @typedef {import("./Compiler")} Compiler */
|
/** @typedef {import("./Compiler")} Compiler */
|
||||||
/** @typedef {import("./Module")} Module */
|
/** @typedef {import("./Module")} Module */
|
||||||
|
/** @typedef {import("./NormalModule")} NormalModule */
|
||||||
|
|
||||||
class WarnCaseSensitiveModulesPlugin {
|
class WarnCaseSensitiveModulesPlugin {
|
||||||
/**
|
/**
|
||||||
|
@ -26,8 +27,13 @@ class WarnCaseSensitiveModulesPlugin {
|
||||||
for (const module of compilation.modules) {
|
for (const module of compilation.modules) {
|
||||||
const identifier = module.identifier();
|
const identifier = module.identifier();
|
||||||
|
|
||||||
// Ignore `data:`, because it's not a real path
|
// Ignore `data:` URLs, because it's not a real path
|
||||||
if (/data:/i.test(identifier)) {
|
if (
|
||||||
|
/** @type {NormalModule} */
|
||||||
|
(module).resourceResolveData !== undefined &&
|
||||||
|
/** @type {NormalModule} */
|
||||||
|
(module).resourceResolveData.encodedContent !== undefined
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -435,6 +435,8 @@ div {
|
||||||
|
|
||||||
div {
|
div {
|
||||||
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E');
|
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E');
|
||||||
|
background-image: url('DATA:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E');
|
||||||
|
background-image: url('DATA:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3Crect width="100%25" height="100%25" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /%3E%3C/svg%3E');
|
||||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>');
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>');
|
||||||
background-image: url('DATA:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>');
|
background-image: url('DATA:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>');
|
||||||
}
|
}
|
||||||
|
@ -504,3 +506,8 @@ div {
|
||||||
background: url(http://example.com/image.jpg);
|
background: url(http://example.com/image.jpg);
|
||||||
background: url(http://example.com/image.jpg);
|
background: url(http://example.com/image.jpg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
background: url('data:,');
|
||||||
|
background: url('data:,');
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue