Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(custom-esbuild): expose current builder options and target to plugins #1878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattlewis92
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

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

PR Type

What kind of change does this PR introduce?

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

What is the current behavior?

The current build target and options are not exposed to plugins, so it's hard to share plugins between all projects in a repo or access current build options.

Issue Number: N/A

What is the new behavior?

The plugins file can expose a factory function that accepts the builder options and target and produces a set of plugins based on the current target and options, which matches the webpack builder behaviour.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Our use case is we want to have a single set of plugins shared between all our applications that can:

  • Use the define option to set the current project name in the codebase
  • Access the stylePreprocessorOptions option value so we can add an additional esbuild sass plugin to support react css modules written in scss.

@mattlewis92 mattlewis92 force-pushed the expose-target-and-options-to-plugins branch from b5080b3 to 33e1f46 Compare November 26, 2024 14:26
@mattlewis92 mattlewis92 force-pushed the expose-target-and-options-to-plugins branch from 33e1f46 to fc44e3a Compare November 26, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant