svg-sprite-loader icon indicating copy to clipboard operation
svg-sprite-loader copied to clipboard

Extract mode fails with pitching loaders

Open sidletski opened this issue 4 years ago • 0 comments

Do you want to request a feature, report a bug or ask a question? A bug/question

What is the current behavior? Looks like svg-sprite-loader using with sprite loader plugin in extract mode doesn't work with pitching loaders

If the current behavior is a bug, please provide the steps to reproduce, at least part of webpack config with loader configuration and piece of your code. Create custom webpack loader with pitching logic. For example, I want to use require('picture.svg') to require picture-dark.svg and picture-light.svg and generate sprite by svg-sprite-loader. Custom loader very basic example: here

It works fine when I try to return module.exports = require(${JSON.stringify(darkPictureRequest)}), but when I'm going to pass more than one file to the svg-sprite-loader with extract option enabled, my next.js page is in state of constant loading. If I understand correctly, there is a similar problem when using extract-text-webpack-plugin, because its loader also uses pitching, so its hooks are called inside the svg sprite plugin.

How can you advise me to change the loader so that everything works correctly?

Please tell us about your environment:

  • Node.js version: 14.17.4
  • webpack version: 5.1.0
  • svg-sprite-loader version: 6.0.9
  • OS type & version: macOS Mojave 10.14.6

sidletski avatar Aug 29 '21 19:08 sidletski