Skip to content

Conversation

mattlewis92
Copy link
Contributor

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
@stefankoserkov
Copy link

will this PR make be merged, it will be nice to have the target options?

@stefankoserkov
Copy link

ping?

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.

2 participants