fix: preprocessor options for the default preprocessor#187
Merged
webdiscus merged 1 commit intowebdiscus:masterfrom Nov 27, 2025
Merged
fix: preprocessor options for the default preprocessor#187webdiscus merged 1 commit intowebdiscus:masterfrom
webdiscus merged 1 commit intowebdiscus:masterfrom
Conversation
bba5601 to
3bf642a
Compare
Owner
|
The use of preprocessor options was intentionally applyed only when the preprocessor itself is explicitly specified. |
Owner
|
@itsyoboieltr , the new v4.22.0 is released. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Types of changes
This PR contains a:
Motivation / Use-Case
When using
HtmlBundlerPluginwith onlypreprocessorOptionsand relying on the default preprocessor, the options were silently ignored.Example:
In this case, preprocessorOptions never reached the loader or the preprocessor.
Breaking Changes
None.
The behavior only changes for configurations where preprocessorOptions were previously ignored when using the default preprocessor. In those cases, the options now correctly take effect as originally intended.
Additional Info
Root cause:
In PluginService.init, preprocessorOptions were only copied into loaderOptions inside the conditional that checks for an explicitly defined preprocessor. When preprocessor is not set (default preprocessor), this condition is false, and preprocessorOptions are never forwarded.
Fix:
Keep the preprocessor assignment guarded as before and move the preprocessorOptions assignment out of that guard so it always propagates when defined, even for the default preprocessor.
This aligns behavior with user expectations and the documented configuration pattern: preprocessorOptions should work whether or not preprocessor is explicitly set.
Checklist
Appreciation for the useful project