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

fix(config): support pass false to plugins #4949

Merged
merged 10 commits into from
Dec 12, 2023
8 changes: 6 additions & 2 deletions packages/rspack/src/rspack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ function createCompiler(userOptions: RspackOptions): Compiler {
for (const plugin of options.plugins) {
if (typeof plugin === "function") {
(plugin as RspackPluginFunction).call(compiler, compiler);
} else if (typeof plugin === "boolean") {
puppet-666 marked this conversation as resolved.
Show resolved Hide resolved
continue;
} else {
plugin.apply(compiler);
}
Expand Down Expand Up @@ -148,8 +150,10 @@ function rspack(
} else {
const { compiler, watch } = create();
if (watch) {
util.deprecate(() => {},
"A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.")();
util.deprecate(
() => {},
"A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback."
)();
}
return compiler;
}
Expand Down
Loading