JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.01k stars 272 forks source link

Webpack 5 with svg-sprite-loader@6.0.2, some options (spriteFilename, outputPath, publicPath) have no effect #446

Closed joseareland closed 3 years ago

joseareland commented 3 years ago

spriteFilename, outputPath and publicPath options have no effect. No errors reported during Webpack compilation.

firestar300 commented 3 years ago

Same problem for me.

DhanushDK17 commented 3 years ago

I encountered these issues in version 6.0.7

When there was no outputPath mentioned the loader had taken the publicPath to move the sprite file after build. The public path was just '/' even after I had mentioned publicPath.

DhanushDK17 commented 2 years ago

I'm still having this issue in version 6.0.9. Assuming publicPath is the path of the file which is used by the browser for accessing the sprite.svg the svg sprite loader doesn't add the publicPath I specify in the config `chainWebpack: (config) => { const svgModule = config.module.rule('svg'); svgModule.uses.clear();

svgModule
  .test(/\.svg$/) // no i18n
  .use('svg-sprite') // no i18n
  .loader('svg-sprite-loader')
  .options({
    extract: true,
    publicPath: '/landingpage/portal/',
    outputPath: '/'
  })
  .end();

svgModule.use('svgo-loader').loader('svgo-loader');

config.plugins.delete('prefetch');`

Also can someone check if the above config is the right one ?. Thanks in advance The webpack version I'm using is webpack@4.41.6 vue@2.6.10

ajotka commented 1 year ago

still having this issue in 6.0.11 :(