I'm developing a webpack custom loader, that is in charge of parsing the javascript and search for certain text using regex.
I need to have a way to collect the data between each parsed file and finally pass that data to a related plugin, so that the plugin can make the appropriate action with that data.
I can use a module to share data between loader calls, but this data is not available in the plugins.
I've been looking at the way the extract-text-plugin does it, since it has a loader and a plugin, but looking at their source code, the way they declare the module is strange to me and I can't really grasp their strategy.
Thanks for any help!
Using a shared module is a viable option, I created a loader/plugin combo that creates an SVG sprite from svgs imported through the loader, here is the repository: https://github.com/crystal-ball/svg-symbol-sprite-loader
Here is how I setup the process:
sprite-store
loader
requires the sprite store and adds any imported SVG to the store.plugin
reads all of the collected data from the sprite store. If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With