Open colinaaa opened 4 hours ago
Rsbuild added support for source.define
because it is a popular feature and almost every application uses it.
But for ProvidePlugin
, I think only a few applications or tools use this plugin, so I prefer to keep it as an opt-in plugin rather than wrap it as an Rsbuild configuration option.
What problem does this feature solve?
Just like
source.define
usesDefinePlugin
,source.provide
usesProvidePlugin
.This is useful for plugin to override other plugin's provides.
Real world use case
We have 2 plugins.
pluginA
which providesFoo
andBar
pluginB
which also providesFoo
, but overridespluginA
Currently, the only way to override the
Foo
inpluginB
is to usebundlerChain
:What does the proposed API look like?
A new configuration
source.provide
is added.