Open m131-8 opened 5 years ago
{
test: /.svg$/,
use: [
{
loader: 'svg-sprite-loader',
options: {
extract: false, // this resolve my conflict
symbolId: 'icon-[name]',
publicPath: '/svg/',
spriteFilename: svgPath => sprite${svgPath.substr(-4)}
}
}
]
}
i'm not use url-loader
has anybody solved this problem? exactly the same one...
See this for answer: https://github.com/kisenka/svg-sprite-loader/issues/149#issuecomment-343839674
same problem
Error: Module build failed (from ./node_modules/svg-sprite-loader/lib/loader.js): InvalidSvg: svg-sprite-loader exception.
module.exports = webpack_public_path + "static/media/admin.5268f502.svg"; at Object.loader (/Users/xiefeng/gitlab-hz/my/react-antd-admin/node_modules/svg-sprite-loader/lib/loader.js:30:11)
i want to know why?
my webpack.config.js configuration { test: /.svg$/, loader: require.resolve('svg-sprite-loader'), include: [path.resolve(dirname, 'src/icons')], options: { symbolId: 'icon-[name]' } }, { test: [/.bmp$/, /.gif$/, /.jpe?g$/, /.png$/, /.svg$/], loader: require.resolve('url-loader'), exclude: [path.resolve(dirname, 'src/icons')], options: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]', }, },