Last active
December 15, 2022 11:17
-
-
Save mohnatus/c249e05280a79b117f4977b214bcfedd to your computer and use it in GitHub Desktop.
Svg sprite webpack loader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loader = { | |
test: /\.svg?$/, | |
use: [ | |
{ | |
loader: "svg-sprite-loader", | |
options: { | |
symbolId: (filePath) => { | |
let fileData = path.parse(filePath); | |
return "svg-icon-" + fileData.name; | |
}, | |
}, | |
}, | |
], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment