@kcws/rspack-config
Version:
rspack configuration builder
28 lines • 653 B
JavaScript
import { ConfigWrapper } from "./wrapper";
/**
* @beta
*/
export class ConfigBuilder {
wrapper;
transformers;
constructor(config, transformers) {
this.wrapper = new ConfigWrapper(config);
this.transformers = transformers;
}
set(config) {
this.wrapper = this.wrapper.set(config);
return this;
}
add(config) {
this.wrapper.merge(config);
return this;
}
use(name, ...params) {
this.wrapper = this.transformers[name](this.wrapper, ...params);
return this;
}
build() {
return this.wrapper.config;
}
}
//# sourceMappingURL=builder.js.map