Customize the build process.
Array<RspackPluginInstance | RspackPluginFunction>
[]
interface RspackPluginInstance {
apply: (compiler: Compiler) => void;
}
Among them, the interface provided on Compiler can refer to Plugin API.
usage:
class CustomPlugin {
apply(compiler) {
// some operations
}
}
module.exports = {
plugins: [new CustomPlugin()],
};
type RspackPluginFunction = (this: Compiler, compiler: Compiler) => void;
usage:
function customPlugin(compiler) {
// some operations
}
module.exports = {
plugins: [customPlugin],
};