Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract mode fails with pitching loaders #471

Open
sidletski opened this issue Aug 29, 2021 · 0 comments
Open

Extract mode fails with pitching loaders #471

sidletski opened this issue Aug 29, 2021 · 0 comments

Comments

@sidletski
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant