Skip to content

Commit

Permalink
fix: exclude sprite.svg from html loader
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnsgn committed Aug 14, 2021
1 parent 3e68295 commit 1707dd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/loaders/markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ const markup = {
loader: "html-loader",
options: {
minimize: NODE_ENV === "production",
sources: {
urlFilter: (attribute, value) => {
return !(attribute === "xlink:href" && /sprite\.svg/.test(value));
},
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const getPageInstanceRecursively = (page) => {
posthtmlImageSources({
replaceExtension: true,
classIgnore: ["u-no-picture-wrap"],
extensionIgnore: ["svg"],
extensionIgnore: ["svg", "gif"],
})
)
.process(content, { sync: true });
Expand Down

0 comments on commit 1707dd5

Please sign in to comment.