Making this package compatible with Webpack v5 #194
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves the deprecation warning with regards to the normal-module-loader, invoking the loader from it's new location.
Also, adding an option of passing an array of strings of names of all the plugins that it should refrain from tracking.
A little background about this:
So the basic way of SMP plugin to measure plugin-timings is that it wraps each plugin into a Wrapper Plugin which has hooks to measure time before and after completion.
Since plugins like the MiniCSSExtractPlugin throw can exception when the invoker is not from the main MiniCSSExtractPlugin class, we need to exclude it from wrapping within the plugin.
Now here's how you can do this with this PR.
Alongside just sending the parameter of
config
insmp.wrap(config)
, you now also share the names of the plugins that usually fail the build or start of the dev server (Example: ReactRefreshPlugin while we are using SMP plugin in react dev server).So the syntax would be:
smp.wrap(config, ['MiniCSSExtractPlugin', 'ReactRefreshPlugin'])
And voila!
You can now use the package in your code without worrying that it would fail the builds or blow the code at runtime.
I don't know if and when this would be integrated in the package, so I'll also be making a separate package of this soon.
Hope it helps :)