For loading svg files to your typescript codes.
///<reference types="@pucelle/webpack-svg-loader" />
or
declare module '*.svg' {
export default string
}
// Variable `svg` is svg code string.
import svg from 'svg-file-name.svg'
{
module: {
rules: [
{
test: /\.svg$/,
loader: '@pucelle/webpack-svg-loader',
options: {
/**
* Whether compress svg codes.
* Default value is `true`.
*/
compress: boolean
// The stroke or fill color which match main color will be replaced to `currentColor`,
// so that you can re-modify the color from css codes,
// or inherit color from ancestral elements.
// Be `null` by default.
mainColor: '#000',
},
}
]
}
}