babel-loader icon indicating copy to clipboard operation
babel-loader copied to clipboard

Add more exhaustive example on customized-loader

Open comoser opened this issue 4 years ago • 2 comments

Please check if the PR fulfills these requirements

  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [x] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

In the documentation for babel-loader, we can find an entry for a customized loader. In this documentation the example given provides clues to customOptions in the loader, but doesn't actually use it to pass those options to a custom plugin provided to the config function.

The custom options are described: image

And then the plugin doesn't use anything. image

On top of this, the parameters that are passed to the plugin don't contain the customOptions defined.

What is the new behavior?

Update the documentation to provide a more exhaustive example on how to pass the customOptions to the custom plugin provided to the config function.

Based on the pull request that actually implemented this #619.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

comoser avatar Mar 18 '21 16:03 comoser

@nicolo-ribaudo not sure on how to fix all these checks since I only touched an .md file 🤔 any tips?

comoser avatar Mar 19 '21 10:03 comoser

Thanks! The CI error is unrelated.

Then if the ci errors are unrelated, then feel free to merge the PR @JLHwung . I can’t perform the merge

comoser avatar May 22 '21 11:05 comoser