feat: validate chunk-related options for the plugin#1890
Open
n0th1ng-else wants to merge 2 commits into
Open
Conversation
THe plugin accepts `excludeChunks` and `chunks` options that tell which JS modules to inject into the html. In fact it accepts arbitrary strings as the values. This makes it confusing while refactoring the bundler configuration, as old and non-existing chunk names may be specified and I have to understand, if it something with the build, or the plugins configuration was not adjusted during the past updated. I am suggesting to add the plugin options validation, so the plugin will throw an error if the mentioned chunk do not exist in the build
Collaborator
alexander-akait
left a comment
There was a problem hiding this comment.
Good improvement, but I am afraid it will be a breaking change, because other can have the same, I think logging warning is a better solution with TODO throw error in the next major release
Author
|
@alexander-akait super, appreciate your time and the suggestion. Yes I can definitely make it a warning in the scope of this PR 🌀 I will also prepare the follow-up PR to turn it into an error, so once you plan the major release, it will be ready 👍🏿 |
THe plugin accepts `excludeChunks` and `chunks` options that tell which JS modules to inject into the html. In fact it accepts arbitrary strings as the values. This makes it confusing while refactoring the bundler configuration, as old and non-existing chunk names may be specified and I have to understand, if it something with the build, or the plugins configuration was not adjusted during the past updated. I am suggesting to add the plugin options validation, so the plugin will throw an error if the mentioned chunk do not exist in the build
Author
|
@alexander-akait I have updated the PR. let me know if I can do something else 👍🏿 |
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.
The plugin accepts
excludeChunksandchunksoptions that tell which JS modules to inject into the HTML. In fact, it accepts arbitrary strings as the values.This makes it confusing while refactoring the bundler configuration, as old and non-existing chunk names may be specified, and I have to understand if it's something with the build, or the plugins configuration was not adjusted during the past update.
I am suggesting adding the plugin options validation, so the plugin will throw an error if the mentioned chunk does not exist in the build
Examples: